Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Macro with multiple Lines of text for email OL 2007 (http://www.outlookbanter.com/outlook-vba/81686-macro-multiple-lines-text-email.html)

Winnipeg Michael November 13th 08 05:00 PM

Macro with multiple Lines of text for email OL 2007
 
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

Preston November 13th 08 05:23 PM

Macro with multiple Lines of text for email OL 2007
 
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

"Winnipeg Michael" wrote:

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


Winnipeg Michael November 13th 08 05:33 PM

Macro with multiple Lines of text for email OL 2007
 
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

"Preston" wrote:

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

"Winnipeg Michael" wrote:

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


Preston November 13th 08 05:59 PM

Macro with multiple Lines of text for email OL 2007
 
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


"Winnipeg Michael" wrote:

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

"Preston" wrote:

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

"Winnipeg Michael" wrote:

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


Winnipeg Michael November 13th 08 06:16 PM

Macro with multiple Lines of text for email OL 2007
 
You mean to try this:

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



"Preston" wrote:

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


"Winnipeg Michael" wrote:

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

"Preston" wrote:

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

"Winnipeg Michael" wrote:

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



All times are GMT +1. The time now is 02:48 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com