View Single Post
  #5  
Old March 13th 14, 10:49 AM
JackTF JackTF is offline
Junior Member
 
First recorded activity at Outlookbanter: Mar 2014
Posts: 1
Default

Quote:
Originally Posted by Outlook Dabbler View Post
Thanks Ken ! for replying back. I am using this Outlook VB code to load the
body of emails from our customers into our CRM application. Is there no way I
can get to the body of the digitally signed emails ? thanks..

regards,
Shiv Kotagal


"Ken Slovak - [MVP - Outlook]" wrote:

You cannot read signed messages from Body it will return an error. Check the
message class of the item and if it's a signed or encrypted message skip it.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Outlook Dabbler" Outlook wrote in
message news
Hi All, my VB macro in Outlook fails while accessing the body of digitally
signed emails. The following line,

mystring = MailItem.Body

fails giving error pop-up saying "Run-time error '-1040171007 (c2004001)':
The operation failed"

Can somebody pl give me a clue how to get around this ? thanks a bunch !


I've found a solution: you have to forward the mail once before accessing the body:

_MailItem newMail = ((_MailItem)eMail).Forward();
newMail.Close(OlInspectorClose.olDiscard);
newMail = null;

After it the mail is opened in ui mode and all properties can be accessed.
Ads