Ferhat FissFiss
Ferhat FissFiss

Reputation: 1

trying to add a message in a VBS script

Im trying to add a message in a VBS script and cant figure it out, below is the script i have:

'email standard for CMG notification - ferhat    
Dim myDateString, myStart, myMessage    

myDateString = Date()    
myStart = InputBox("CMG P47 complete Y/N")    

if UCase(myStart) = "Y" then    
myMessage = "CMG - P47 " & myDateString    
elseif UCase(myStart) = "N" then
myMessage = "ATTN: CMG - P47 " & myDateString    
else    
MsgBox "Fer said: Thats not an answer!"    
WScript.Quit    
end if    

Set outlookApp = CreateObject("Outlook.Application")    

olMailItem = 0    
Set newMessage = outlookApp.CreateItem(olMailItem)    

newMessage.To = "[email protected]"    
newMessage.Cc = "[email protected];  [email protected]"    
newMessage.Subject = myMessage    
newMessage.Display     

Im trying to add the following text:

Hi,

Please note that P47 has been completed for today.

Upvotes: 0

Views: 180

Answers (1)

Roger Barreto
Roger Barreto

Reputation: 2284

Use the .Body property

newMessage.Body = "Hi, " & vbcrlf & vbcrlf & _
                  "Please note that P47 has been completed for today."

I've found some examples in this site: http://www.slipstick.com/developer/create-a-new-message-using-vba/

Upvotes: 1

Related Questions