.Body Property very long

mari_hitz

Registered User.
Local time
Today, 13:17
Joined
Nov 12, 2010
Messages
120
Hi everybody!

I would like to make a quick question. I have a code in a form of my database that sends an e-mail to the people in it.
In the code I have ".Body="; I have written the following:

.Body= "Please read information attached."

I would like to know if there is any possibility to add a more extensive verbiage including space between paragraphs. I have tried to do this by adding the following:

.Body= "Text"_
"Text"_
"Text"_
"Text"_

But the vba says there is an error, first it says "_" is an invalid character.

Is possible to add an extensive verbiage with this property?

Thanks!
 
I don't know what the limit for body text is but I would create a variable and populate it. Then use the variable to populate .body.
 
thanks for your reply!

If I create a Table with the information I want. Could I indicate the .body property to look the body of the message on that table? If so, how should I do it? Thanks!
 
you need the & character for succesive lines

body = "some text " & _
"some more text" & _
" a bit more text"

I tihnk there is a (vba) limit to the number of & you can use

alternatively

body = "some text "
body = body & "some more text" & _
body = body & " a bit more text"

note there is also a constant vbcrlf to add a line feed (and vbtab to add a tab character)

a third alternative is to store it in a text file, and load the text file
a fourth alternative is to store it in a memo field in a table, and load it from that

the last 2 make editing the text easier, as you do not need to rebuild the app.
 
Another solution if using Outlook, and all emails will have the same body, you can create an email template (which can be edited) and when you create the mail item, use the email from template item
David
 
Thank you all for your answers.

1)I have created a table with that contains the memo, so if I would like to indicate the access to go there I should put the following? :

.body= tables!table1!memo

Where "table1" should have the number of the table and "memo" the name of the field where the memo is storaged? (Note that I have created 3 differents table for each memo-I have to sent 3 types of memos)

2) If I create outlook templates, should I save them as "Outlook template" in my pc and later add them to the code by inserting the path to the document?

Thanks and regards!
 
2) Yes, create it in Outlook and save as a template noting the name and filepath in doing so and this can then be used when you create your mail item
David
 

Users who are viewing this thread

Back
Top Bottom