1

I'm trying to fix up a mailscript.

I pretty much need something like

cmBody = "c:\body.txt"

It's not that simple, but you get the idea.

The txt file is the content of the email.

I hope you guys can help me out.

2
  • Can you be more specific and detailed? you are running around the question... :$ Commented Jan 21, 2013 at 12:21
  • Yeah, sorry. I want cmbody to contain the content of body.txt edit: I think I got it. I'll post the answer. Commented Jan 21, 2013 at 12:27

2 Answers 2

2

You can do like this:

    Dim fso As Object
    Dim contents As String

    Set fso = CreateObject("Scripting.FileSystemObject")
    contents = fso.OpenTextFile("c:\temp\test.txt", ForReading).ReadAll()
Sign up to request clarification or add additional context in comments.

Comments

1

I got it.

This is the code I ended up using. (If any of you even understood the question)

Open "C:\body.txt" For Input As #intFile
strFile = Input$(LOF(intFile), #intFile)
Close #intFile
cmBody = strFile

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.