A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

VB Macro fails on Digitally Signed Emails



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 25th 06, 10:32 PM posted to microsoft.public.outlook.program_vba
Outlook Dabbler
external usenet poster
 
Posts: 1
Default VB Macro fails on Digitally Signed Emails

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 !

Ads
  #2  
Old January 26th 06, 04:25 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default VB Macro fails on Digitally Signed Emails

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 !


  #3  
Old January 26th 06, 05:19 PM posted to microsoft.public.outlook.program_vba
Outlook Dabbler
external usenet poster
 
Posts: 1
Default VB Macro fails on Digitally Signed Emails

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 !



  #4  
Old January 27th 06, 04:59 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default VB Macro fails on Digitally Signed Emails

Not from the Body or any of the other standard methods.

What you want is actually an attachment on the item. See
http://www.tech-archive.net/Archive/...5-01/0180.html
for a little more information about that.

Also see http://support.microsoft.com/?kbid=194623 for information about
detecting signed/encrypted information. It's a CDO 1.21 article but applies
to the Outlook object model also.

--
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" wrote in
message ...
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


  #5  
Old March 13th 14, 11: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.
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Macro Sanjeev kumar Kodavalla Outlook - Using Forms 2 March 5th 06 08:24 PM
Outlook Startup fails Tomk Outlook - Installation 0 March 3rd 06 04:41 PM
iCal import fails Otto Outlook - Calandaring 3 March 1st 06 04:12 PM
Running a macro SuperSlueth Outlook - Using Forms 15 February 7th 06 10:51 PM
Detecting signed/encrypted mail messages [email protected] Add-ins for Outlook 1 January 29th 06 10:30 PM


All times are GMT +1. The time now is 11:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.