Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro Help Please: New User 1

Status
Not open for further replies.

chingchui

Technical User
Jan 9, 2009
1
US
Hello Members,

I do not use Macros but recently I have tried to create a Macro in OUTLOOK 2000, It is a simple "Mail" macro.

I am try to create a Macro that will simply reply to an email message with a few sentences. Can someone help me create an "email macro" that simple automatically types a message in the "body" of the message. I spent most of the day on google, but the only macro I found was the one below. which only adds a message to the "subject" area.
I would like to add a message also to the "body" of the mail message as well, but do not understand to do it. Can someone please explain how to create a "mail" macro in Outlook 2000 for beginners like myself. Here is a Macro I found on google, but it only adds one line in the subject area: Thankyou all for your help., Ric

Sub HelloWorldMessage()
Dim msg As Outlook.MailItem
Set msg = Application.CreateItem(olMailItem)
msg.Subject = "Hello World!"
msg.Display
Set msg = Nothing
End Sub
 
Hi,

If you open the Object Browser in the VB Editor, you'll find that Body is a property of the MailItem Object. You may even find other interesting, helpful and exciting things.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
If you have IntelliSense turned on (which you should) then try typing:
Code:
Sub HelloWorldMessage()
    Dim msg As Outlook.MailItem
    Set msg = Application.CreateItem(olMailItem)
    msg.Subject = "Hello World!"
    msg.

In other words, "msg." - msg and dot

If you have IntelliSense on, then you get a HUGE popup list of possible things...including Body.
Code:
    Dim msg As Outlook.MailItem
    Set msg = Application.CreateItem(olMailItem)
    msg.Subject = "Hello World!"
    msg.Body = "This is a bit of text for the body."

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top