-
I want to code a form that im able to create a text file such like this:
Example Textfile:
IP"192.168.100.10" Subnet"255.255.255.0"
The Word "IP" and "Subnet" should be set automaticly on this position and the two adresses should come from two seperatet textboxes im my form!
My question is : HOW??? :-))
-
Simply open a file for output and use the print keyword to type to it.
Code:
Dim iFile As Integer
iFile = FreeFile
Open "C:\MyFile.txt" For Output As #iFile
Print #iFile, "IP "; txtIPAddress; " Subnet "; txtSubnet
Close #iFile
Good luck!
-
Joacim,
That is a more elegant solution than I came up with. Minor point. If you need the double quotes in the output string, just put in chr(34).
Code:
Print #iFile, "IP "; Chr(34); txtIpAddress; Chr(34); " Subnet "; Chr(34); txtSubnet; Chr(34)
-
Yes, you can also add two quotation marks.
Code:
Print #iFile, "IP """; txtIPAddress; """ Subnet """; txtSubnet; """"