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 cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

API fill text box from text file

Status
Not open for further replies.

swmetal

Mechanical
Joined
Oct 13, 2006
Messages
58
Location
US
Hello
Trying to fill userform text box from a textfile with the selection from a command button. Can anyone help?
I've listed what I have below. Thanks

Private Sub cmdTest_Click()

Dim fso As New FileSystemObject
Dim Text As TextStream
Dim strTextPath As String

strTextPath = "C:\\Desktop\VariablesFolder\File.txt"

Set Text = fso.OpenTextFile(strTextPath, ForReading)

txtTest.Text = Text.ReadAll

Text.Close

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top