Display a formatted text box for filling

0

Good morning Sirs, I searched the entire internet but I do not think I was able to express myself so I ask you ... I have a VB command to change the ip of win7 but I would like the command to ask what ip I would like to put following 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 the strIPAddress = Array("10.10.0.7") 'Coloque o IP fixo part I would like you to open a text box for the user to change the end or if the integer ip is not possible, for example:

10.10.0.___
    
asked by anonymous 19.09.2018 / 19:25

1 answer

0

The simplest way is to use an inputbox. Example:

ip = InputBox("Coloque o IP fixo", "Mudar IP")

Another more laborious but one that would bring better aesthetic results would be to make a form and call it returning the result to its variable.

    
19.09.2018 / 19:35