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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook 2010 Signature overwritten by body in vba call

Status
Not open for further replies.

tman138

IS-IT--Management
Nov 27, 2001
128
0
0
US
I have an Access app that feeds a semi-automated e-mail. My problem is that I can touch the e-mail to get the signature to display using .display but as soon as I write the body, the signature is overwritten.
Here is trunacted code depicting problem:
Sub Test()
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

objOutlookMsg.To = "address"

objOutlookMsg.Subject = "Subj"
objOutlookMsg.Display
objOutlookMsg.Body = "body"

End Sub
When I step through the code writing .body cancels the default signature.

Does anyone know how to get around this?
 
What happens if you replace this:
objOutlookMsg.Display
objOutlookMsg.Body = "body"
with this ?
objOutlookMsg.Body = "body"
objOutlookMsg.Display

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top