Display a formatted text box for completion
Good Morning Gentlemen, I searched the entire internet but I don't think I could express myself so I come to ask you… I have a VB command to change the ip of win7 but I would like the command to ask which ip I would like to put follows command...
' ## Script para alterer ip da Placa de Rede ##
Set objWMIService = GetObject("winmgmts:\.\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress = Array("10.10.0.7") 'Coloque o IP fixo
strSubnetMask = Array("255.255.255.0") 'Coloque a Mascara de SubNet
strGateway = Array("10.1.1.1") 'Coloque o Gateway
strGatewayMetric = Array(1)
strDNS = Array("200.204.0.10","200.204.0.138") 'Coloque o IP DNS
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
objNetAdapter.SetDNSServerSearchOrder strDNS
Next
In part strIPAddress = Array("10.10.0.7") 'Coloque o IP fixo
I would like to open a text box for the user to change the end or if the entire ip is not possible, for example:
10.10.0.___
0
Author: davidterra, 2018-09-19
1 answers
The simplest way is to use an inputbox. Example:
ip = InputBox("Coloque o IP fixo", "Mudar IP")
Another more laborious way but that would bring better aesthetic results would be to make a form and call it returning the result to its variable.
0
Author: Lucas Miranda, 2018-09-19 18:37:01