|
-
Aug 24th, 2001, 05:55 AM
#1
open txt files hm
Hi,
i want to open a txt file (could be quite large) and read all the txt from it so i can use my program to email it.. I have the emailing side sorted.. just need to work out how to open my file and send it as txt
Thanks!
-
Aug 24th, 2001, 05:58 AM
#2
Retired VBF Adm1nistrator
Here's a quick way of getting the entire file into a variable.
VB Code:
Option Explicit
Private Sub Form_Load()
Dim fileContents As String
Open "c:\autoexec.bat" For Binary As #1
fileContents = Input(LOF(1), 1)
Close #1
MsgBox fileContents
End Sub
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Aug 24th, 2001, 06:34 AM
#3
Instead of opening and reading the file, if you want to EMail the contents, wouldn't it be simpler to just programmatically attach the file to an EMail message?
-
Aug 24th, 2001, 08:22 AM
#4
but...
i don't know how to do that with the code i have.. this is easier :-)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|