简体   繁体   中英

How to replace the body of a reply to an email and keep signature?

I would like to reply to an email without including the original email, but include the sender as the recipient, the subject, and my signature.

Currently I have Set objDoc = ActiveInspector.WordEditor . I tried looking for the body of the email here, so I can replace it with other text.

I would like to retain the Subject of the email I am replying to, the Sender, and the Recipient.

Here is the code I have for my current reply:

With oReply
    .BCC = bccField
    .CC = ccField
    .HTMLBody = "<HTML><Body><span>my reply here</span><Body></HTML>" & .HTMLBody & "<span>" & "Additional stuff" & "</span>"
End With 

I tried taking out the .HTMLBody in between the <span> s, which does take out the original user's message but also takes out my signature.

Instead of using the reply functionality, just create a new mailItem and transfer the details over.

Example below uses the original email. So wherever you have Set oReply = (something).Reply you will replace or update that with Set originalMailItem = (Something) . This (something) should be the original mail you are attempting to reply to.

In order to effectively insert the signature, we have to .Display the mailItem. Otherwise outlook will note generate the signature. Make sure the signature settings are correct on your outlook client to default to the desired signature for new mail items.

Set newMail = outApp.CreateItem(olMailItem) 'Create a new mail instead of replying to existing

With newMail
    .Display
    .HTMLBody = "<HTML><Body><span>my reply here</span><Body></HTML>" _
    & "<span>" & "Additional stuff" & "</span>" _
    & .HTMLBody 'HTMLBody already contains the signature once the email was displayed so we just tack it onto the end.
    .To = originalMailItem.SenderEmailAddress
    .CC = originalMailItem.CC
    .BCC = originalMailItem.BCC
    .Subject = originalMailItem.Subject
    '.Send     'To send the reply
End With

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM