PC Review


Reply
Thread Tools Rate Thread

Automating saving encrypted attachments in Outlook 2000 using VB

 
 
j
Guest
Posts: n/a
 
      20th May 2004
Hi,
After having a look around on various groups I found lots of code to
automate the saving of attachments on mails to folders on the file
system. This was the primary requirement of a client of mine. However,
they have now come back to me to say that the format of the mails will
be changing to SMIME encrypted emails. They are using Outlook 2000 and
have got personal certificates from Thawte and now have an automated
system emailing them mails that are encrypted using these
certificates. I'm trying to work out if I'll be able to access the
attachments if they are encrypted. I've got a personal cert myself now
and I'm coming up against some problems in my code (abridged version
below)

For I = Fldr.Items.Count To 1 Step -1
Set olMi = Fldr.Items(I)
For Each olAtt In olMi.Attachments
On Error Resume Next
olAtt.SaveAsFile (strPath & olAtt.filename)
Next olAtt
olMi.Save
olMi.Move MoveToFldr
Next I

I'm getting an error on the line of "Set olMi = Fldr.Items(I)"
Run-time error '13':
Type Mismatch

This error doesn't happen when the mail is an unencrypted mail. Does
this mean that encrypted mails are not Outlook.MailItem objects or
what???
Does anyone know whether even if I can get the type right, will I be
able to save the attachment? Normally when I open the mail I get
prompted for a password (this was associated with the cert when I went
through the cert generation process on Thawte.com). How will I be able
to automate this process so that it is invisible to the user?

Any help, ideas, references would be greatly appreciated.

Regards,
Jeremy
 
Reply With Quote
 
 
 
 
Eric Legault [MVP - Outlook]
Guest
Posts: n/a
 
      27th May 2004
What data type is olMi declared as? When iterating through an Items collection,
it is best to use a variable declared as a generic Object type because
of all the different message types that you can encounter. Or else check
the .Class property to see what kind of object it is before processing
it further.

Eric Legault - B.A, MCP, MCSD, Outlook MVP
---------------------------------------------
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/


>Hi,
>After having a look around on various groups I found lots of code to
>automate the saving of attachments on mails to folders on the file
>system. This was the primary requirement of a client of mine. However,
>they have now come back to me to say that the format of the mails will
>be changing to SMIME encrypted emails. They are using Outlook 2000 and
>have got personal certificates from Thawte and now have an automated
>system emailing them mails that are encrypted using these certificates.
>I'm trying to work out if I'll be able to access the attachments if
>they are encrypted. I've got a personal cert myself now and I'm coming
>up against some problems in my code (abridged version
>below)
>
>For I = Fldr.Items.Count To 1 Step -1
>Set olMi = Fldr.Items(I)
> For Each olAtt In olMi.Attachments
> On Error Resume Next
> olAtt.SaveAsFile (strPath & olAtt.filename)
> Next olAtt
> olMi.Save
> olMi.Move MoveToFldr
>Next I
>
>I'm getting an error on the line of "Set olMi = Fldr.Items(I)"
>Run-time error '13':
>Type Mismatch
>
>This error doesn't happen when the mail is an unencrypted mail. Does
>this mean that encrypted mails are not Outlook.MailItem objects or
>what???
>Does anyone know whether even if I can get the type right, will I be
>able to save the attachment? Normally when I open the mail I get
>prompted for a password (this was associated with the cert when I went
>through the cert generation process on Thawte.com). How will I be able
>to automate this process so that it is invisible to the user?
>
>Any help, ideas, references would be greatly appreciated.
>
>Regards,
>Jeremy
>
>




 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving attachments from encrypted email PDAlma Microsoft Outlook VBA Programming 1 15th Jul 2010 02:36 PM
saving attachments in Outlook 2000 =?Utf-8?B?Q2hhcmxlbmU=?= Microsoft Outlook Discussion 1 25th Apr 2005 03:30 PM
Automating saving encrypted attachments in Outlook 2000 using VB j Microsoft Outlook VBA Programming 1 27th May 2004 05:35 AM
Automating saving encrypted attachments in Outlook 2000 using VB j Microsoft Outlook Program Addins 3 24th May 2004 02:54 PM
Outlook 2000 saving attachments Russ Microsoft Outlook 2 23rd Mar 2004 12:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:41 PM.