2

I wonder if it is possible to remove the signature from a email body, when importing that email into excel?

I am trying out the suggested solution from Tony Dallimore from this earlier posted topic, to import email from Outlook into excel.

Community
  • 1
  • 1
  • 1
    Yes, it's possible. What happened when you tried Tony's solution? – Tim Williams Jan 06 '16 at 17:16
  • Hi, tanks for the answer. Noting spesial happend when using this solution. I had hoped that the code showed me som hidden start point in the HTMLBoddy. But it only showed the [CR], [LF], [NBSP] and [TAB] in the text. – Ole Kristian H. Jan 07 '16 at 10:05

2 Answers2

2

Unfortunately, it's nearly impossible unless you can expect some unique text that can signify where the signature begins so you can strip it out. This is possible during compose mode, where any signature is enclosed with the <span style='mso-bookmark:_MailAutoSig'> block. However, that block is removed when the email is sent and is not present in the received copy.

Eric Legault
  • 5,706
  • 2
  • 22
  • 38
  • Hi, thanks for the answer. That was the same impression I had after googling this. But I hoped that it was a small opportunity that the signature had some hidden start reference that was saved after the mail was sendt. I have tried Regex too. Tried making a pattern that could recognize the start position.But I gave up. Thanks again for the response! – Ole Kristian H. Jan 07 '16 at 09:54
1

Eric's suggestion makes any sense only in case HTML based messages.

But users may prefer composing items in plain text. In that case the suggested way of searching bookmarks will fail. You need to know the signature content and search it in the body.

By default you can find the Signatures folder in the following location;

Windows XP

  • C:\Documents and Settings\%username%\Application Data\Microsoft\Signatures

Windows 8, Windows 7 and Windows Vista

  • C:\Users\%username%\AppData\Roaming\Microsoft\Signatures Look for the following files and folders;

[signature_name].htm - This file is used when creating HTML messages.

[signature_name].rtf - This file is used when creating Rich Text messages.

[signature_name].txt - This file is used when creating Plain Text message.

[signature_name]_files - This folder is used in Outlook to store supporting files for your signature such as formatting, images and/or business cards (vcf-files).

So, you can check the folder for a corresponding signature file, read the file content and try to find such text in the message body depending on the BodyFormat used.

The Outlook object model provides three main ways for working with item bodies:

  1. Body - a string representing the clear-text body of the Outlook item.
  2. HTMLBody - a string representing the HTML body of the specified item.
  3. Word editor - the Microsoft Word Document Object Model of the message being displayed. The WordEditor property of the Inspector class returns an instance of the Document class from the Word object model which you can use to set up the message body.

You can read more about all these ways in the Chapter 17: Working with Item Bodies. It us up to you which way is to choose to customize the signature in the message body.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45