Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple "add to email list"

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How do I have text typed into a box and submitted, write to a file where I can view it.

Something like a "to join our email list, type it here" type of thing.
 
dncnnc,
'First you can capture a users input by using the InputBox
'InputBox(prompt[, title] [, default] [, xpos] [, ypos] [, helpfile, context])

Dim Message, Title, Default, MyValue
Message = "To join our e-mail list, type it here:" ' Set prompt.
Title = "Join" ' Set title.
Default = "dncnnc@home.org" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)

' Then use a file system object to store the info to a file.
Dim fs, a
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\testfile.txt", True)
a.WriteLine(MyValue)
a.Close

Both of these examples are available at the MSDN VBScript help site. If I were smarter, and not so lazy, I would provide you the link ;-)

Zy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top