0

我试图在 VBS 脚本中添加一条消息但无法弄清楚,下面是我拥有的脚本:

'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 = "ithelpdesk@test.com.au"    
newMessage.Cc = "itoperations@test.com.au;  operations@test.com.au"    
newMessage.Subject = myMessage    
newMessage.Display     

我试图添加以下文本:

Hi,

Please note that P47 has been completed for today.
4

1 回答 1

1

使用 .Body 属性

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

我在这个网站上找到了一些例子:http ://www.slipstick.com/developer/create-a-new-message-using-vba/

于 2013-08-25T05:48:40.860 回答