G
Gustaf
Found this code for opening a textfile in a textbox on a custom VBA form:
Private Sub UserForm_Initialize()
Dim hFile As Long
Dim sFilename As String
sFilename = conLinkHelpdesk
hFile = FreeFile
Open sFilename For Input As #hFile
txtText.Text = Input$(LOF(hFile), hFile)
Close #hFile
End Sub
Works fine, but when the form opens, the cursor is at the bottom, which causes the end of the textfile to show, rather than the beginning. Is there a way to correct this?
Gustaf
Private Sub UserForm_Initialize()
Dim hFile As Long
Dim sFilename As String
sFilename = conLinkHelpdesk
hFile = FreeFile
Open sFilename For Input As #hFile
txtText.Text = Input$(LOF(hFile), hFile)
Close #hFile
End Sub
Works fine, but when the form opens, the cursor is at the bottom, which causes the end of the textfile to show, rather than the beginning. Is there a way to correct this?
Gustaf