Text file as Body of Outlook (1 Viewer)

insanity

Monkeys do the work!
Local time
Today, 12:09
Joined
Jan 8, 2002
Messages
14
I'm having a dumb brain day and require some assistance please:

I have a Word document which I want to use as the body of an automated email (using Outlook.Application method not SendMessage) but for the life me I can't figure out how to use this?

I want minimal user input. The contact is from a drop down which is linked to a table with email, name, company etc which goes into the email already.

Can someone please enlighten me how to 'embed' the body?

Alternatively, how do I "import" a text file into a string?

Thanks.

Peter
 

insanity

Monkeys do the work!
Local time
Today, 12:09
Joined
Jan 8, 2002
Messages
14
Oh, the reason i'm posting here is it's being run from an Access database and automating an Outlook email.

Thanks for link, however the help file doesn't go into this detail.

What i'm trying to acheive is a standard email is going to be sent to our stakeholders upon a trigger (i.e. failure to return a document on time). I want to make the body of the email 'dynamic', in the sense that if the content needs to change, someone doesn't have to go into a Module and change the code, instead they replace the text file and the code picks up the new body.

I've hunted all over the web without much success, so I am guessing the easiest way would be to turn the .txt file into a long string and set
Code:
 .Body = strImportedTextFile
. What i'm attempting to do is set something like .Body = .add("c:\textfile.txt") sorta thing but can't find out how.

Can anyone enlighten please?

Thanks,
Peter
 

insanity

Monkeys do the work!
Local time
Today, 12:09
Joined
Jan 8, 2002
Messages
14
Got it.

I figured out what i'm trying to do, here is the code:

Code:
Dim f As Integer
f = Freefile
Open "c:\body.txt" For Input As f
Me.txtText = Input(Lof(f), f)
Close f
 

Users who are viewing this thread

Top Bottom