• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 472
  • Last Modified:

Determining in VBA if an Outlook 2003 mail item has been digitally signed

I have VBA code in an Excel 2003 macro which reads through my Outlook 2003 Inbox that looks like this...

            Set oolFolder = ns.GetDefaultFolder(olFolderInbox)
            For Each oolItem In oolFolder.Items
                If oolItem.Class = olMail Then
                    Set oolMailItem = oolItem  ...

"oolItem" is defined as an Object, since there appears to be no generic "Item" definition.

This code works fine until I get to a piece of mail that has been digitally signed.  When it attempts to set oolMailItem to oolItem, it gets a "Type mismatch".  This only happens on digitally signed mail items.

I cannot seem to find a way to determine that a piece of mail has been signed so that I can skip processing the email.  I can't find a property or method that would give me the information.

I use Windows XP Pro SP2.

Ideas?
0
THVanderWall
Asked:
THVanderWall
  • 4
  • 3
1 Solution
 
peakpeakCommented:
What are you trying to accomplish really?
0
 
THVanderWallAuthor Commented:
I am in the experimental stage of developing a spreadsheet of information about all of my emails.  (Maybe it will end up as an Access database.)  I am willing to skip those few emails that arrive digitally signed.  So I am trying to figure out a way to determine that the mail item is digitally signed before I try to assign it to a MailItem object and work with it.  
0
 
peakpeakCommented:
What about On Error Goto ?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
THVanderWallAuthor Commented:
I tried that, but it doesn't seem to work correctly.  I may putz with On Error a bit more, but so far it hasn't worked for me.  I was just hoping for an undocumented property or method that I could use.
0
 
THVanderWallAuthor Commented:
Well I guess you get the points.  I putzed some more and I had evidently been doing something wrong the first time around.  Error Goto does just what I want now.   :-)
0
 
peakpeakCommented:
I'm not fond of VB at all, forced to uset it in my Access member registers, takes 10 times longer to code anything in VB than in C. However, seems to me you need to investigate in the oolItem object BEFORE you assign it to something, maybe there's some property there telling you to stay away :)

0
 
peakpeakCommented:
Thank you THV, hope you acheive your goal
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now