Ferhat Er
asked on
Need help with VBScript adding Signature
I have the following script and I need it to also pick up the Outlook signature when sending.
I know is can while in Outlook click on insert and add the signature, but was wondering if I can add this to the VB Script.
Dim datYesterday, strDDMMYY, myStart, myMessage, myattachment, strEmail
datYesterday = DateAdd("d", -1, Now())
strDDMMYY = Right("0" & Day(datYesterday), 2) & Right("0" & Month(datYesterday), 2) & Right(Year(datYesterday), 2)
strEmail = Right("0" & Day(datYesterday), 2) & "/" & Right("0" & Month(datYesterday), 2) & "/" & Right(Year(datYesterday), 2)
myattachment = "N:\Users\Production\ops\O ps Documents\PCOMB Errors\Pcomb Error Report " & strDDMMYY &".doc"
myMessage = "PCOMB Timings & Error Report " & strDDMMYY
Set outlookApp = CreateObject("Outlook.Appl ication")
olMailItem = 0
Set newMessage = outlookApp.CreateItem(olMa ilItem)
newMessage.To = "test@hotmail.com"
newMessage.Subject = myMessage
newMessage.Attachments.Add "N:\Users\Production\ops\O ps Documents\Spreadsheets and templates\PCOMB_Timings.xl s"
newMessage.Attachments.Add "N:\Users\Production\ops\O ps Documents\PCOMB Errors\Pcomb Error Report " & strDDMMYY &".doc"
newMessage.Body = "Good Morning," & vbCrLf & vbCrLf & "Please find attached the PCOMB Timings and Error Report for " & strEmail & "." & vbCrLf
newMessage.Display
Any help is appreciated.
Kind Regards,
Ferhat ER
I know is can while in Outlook click on insert and add the signature, but was wondering if I can add this to the VB Script.
Dim datYesterday, strDDMMYY, myStart, myMessage, myattachment, strEmail
datYesterday = DateAdd("d", -1, Now())
strDDMMYY = Right("0" & Day(datYesterday), 2) & Right("0" & Month(datYesterday), 2) & Right(Year(datYesterday), 2)
strEmail = Right("0" & Day(datYesterday), 2) & "/" & Right("0" & Month(datYesterday), 2) & "/" & Right(Year(datYesterday), 2)
myattachment = "N:\Users\Production\ops\O
myMessage = "PCOMB Timings & Error Report " & strDDMMYY
Set outlookApp = CreateObject("Outlook.Appl
olMailItem = 0
Set newMessage = outlookApp.CreateItem(olMa
newMessage.To = "test@hotmail.com"
newMessage.Subject = myMessage
newMessage.Attachments.Add
newMessage.Attachments.Add
newMessage.Body = "Good Morning," & vbCrLf & vbCrLf & "Please find attached the PCOMB Timings and Error Report for " & strEmail & "." & vbCrLf
newMessage.Display
Any help is appreciated.
Kind Regards,
Ferhat ER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
BTW, I appreciate you endorsing my comment, but that's not entirely how it works. You need to accept a comment as the answer in order to show proper appreciation. See here for more info.
Open in new window