Macro with multiple Lines of text for email OL 2007

W

Winnipeg Michael

I'd like to create a macro, that will email a person, and the in the body of
the email, there are multiple lines of text.
I can get the email address set up, and one line of text. How can I add 2
or 3 more lines in the macro?

Thanks,
Michael
 
P

Preston

i think that maybe you are looking for the linefeed constant.
try using
mymail.body = "some text" & vbCrLf & "some more text" & vbCrLf & "yet more
text."

this will add a carriage return to the text being put in the body.

Preston
 
W

Winnipeg Michael

Brilliant!!! Thanks, Preston.

It looks so good, I have to ask this.
Is there a way to have the cursor to be at the start of the 4th line of text?

Thanks,
Michael
 
P

Preston

If you have something that you want to append to the body then you might try
always making the last character in the body be vbCrLf. Then when you append
things to the body you can use the logic
mymail.body = mymail.body & "new text to add at the end"

alternatively you could just make sure and add vbCrLf to the beginning of
new text to be added.
hopefully this works for you

Preston
 
W

Winnipeg Michael

You mean to try this:

mymail.body = "some text" & vbCrLf & "some more text" & vbCrLf & "yet more
text" & vbCrLf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top