LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Opening textfile in textbox + moving to top

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TextBox validation before moving to next LuisE Excel Programming 3 August 25th 07 11:48 PM
Moving Data on opening Excel Rainbow-Lentil New Users to Excel 3 July 12th 07 04:43 PM
Textbox keeps moving [email protected] Excel Programming 1 June 15th 05 12:34 AM
Opening and saving textfile into XLS MicMast Excel Programming 1 August 4th 03 01:33 PM
Code for moving textbox Phil Perry Excel Programming 2 July 9th 03 03:49 PM


All times are GMT +1. The time now is 09:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"