Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Recurring e-mail message in Outlook

Status
Not open for further replies.

NXProf

Mechanical
Nov 28, 2012
45
Hello,

I have a really simple question. I'm attempting to create a reoccurring e-mail message in Outlook, in which I've located the following link, which works well: But my question is "How can I make multiple lines within the Body of the reoccurring e-mail on the below line 'NewItem.Body = "This is text that will appear in the body of the message."'?" The VB code that is provided in the above link is as follows:
Sub Item_PropertyChange(ByVal Name)
Select Case Name
Case "Status"
if Item.Status = 2 then '2 = Completed
Set NewItem = Application.CreateItem(0)
NewItem.To = "myemailaddress@myisp.com"
NewItem.Recipients.ResolveAll
NewItem.Subject = "This is the message subject text"
NewItem.Body = "This is text that will appear in the body of the message."
NewItem.Display
End IF
End Select
End Sub

Thank you for your response(s) ahead of time!
NX Prof
 
Replies continue below

Recommended for you

Better question for tek-tips.

Dan - Owner
URL]
 
Separate the lines with vbcrlf. eg
Code:
NewItem.Body = "This will appear in the body" & vbCRLF & _
   "Time after time" & vbCRLF & _
   "After time after time"
Alternatively you can concatenate it on different lines of code if you don't like continuation lines
 
Thank you MacGyverS2000 for the tip.

And thank you so much xwb for your code, which worked well! Any ideas on how to have the automatic e-mail to include the Yes/No Vote option as if sending the e-mail as a normal e-mail? Thank you again!
 
If you go into vba and type NewItem. and wait a while, it will come up with all the attributes that the items have. The one you are looking for is VotingOptions
Code:
NewItem.VotingOptions = "Yes;No"
You do not have to be restricted to Yes and No - all the options have to be separated by ; eg if it was where would you like to go for the company do, it could be something like
Code:
NewItem.VotingOptions = "Sea side;Skiing;Trade Show;Clay pigeon shooting"
 
Thank you very much xwb for the Voting options code, which is working well!

Have a wonderful weekend!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor