0
votes

I tried isolating the body of a received Outlook email in a macro, using the following code:

Dim inspector As Outlook.inspector, email As Outlook.MailItem, body As String
Set inspector = Application.ActiveInspector
Set email = email.subject
body = email.Body

The problem is, when I print out the contents of this variable in a MsgBox, it has the person's signature included. Is there a different attribute other than Body to use for this? Some way to isolate the body of the mail item without the sender's signature, if they added one?

For bonus points: if email is an email that was forwarded to me, Body also includes information (header details/metadata, the body itself, and a signature if present) from all the previous emails in the forwarding chain. Is there a way to isolate just the body of the current mail item rather than all the associated ones?

1
NO. there's no separate attribute for signature. For the editor and object model everything inside is just Body. Only way is to parse the content and run some code over it to exclude signature(s). - cyboashu

1 Answers

0
votes

Outlook places the new signature inside the "_MailAutoSig" bookmark, which can be accessed through Document.Bookmarks.Item("_MailAutoSig"), where Document can be retrieved from Inspector.WordEditor.