Save email messages to local folder

D

David Baber

our organization has an application that parses email messages and
places the data into a database. At the moment the email messages are
manually saved to a folder on the network. (The application has no
mail interace). It was fine when we barely had 10 messages a day.
Now there is over 300 emails a day. I tried to use the following
macro:

sub SaveMessages()

Dim objFolder as MAPIFolder
Dim objMessage as MailItem

Set objFolder = Application.Session.PickFolder

For Each objMessage in ObjFolder
objMessage.SaveAs "<network folder>" & objMessage.Subject &
".msg", olMSG
Next

Set objMessage = Nothing
Set objFolder = Nothing

end sub

The following problem(s) occur:

1. The Microsoft Outlook security box keeps coming up. Even after
setting the "Allow Access" to 10 minutes, it comes up after about
every 10 messages.

2. Anything with an RE or FW in the subject causes a blank file to be
created.

3. The following error occurs with some files that have attachments:
Run-time error '-1767702276 (96a300fc)'
The operation failed.

Because of security rules and policies, I can't just download a dll,
or application to use in place of it. This application has begun the
phase for being upgraded, but it has at least a year plan laid out, if
not longer. Any help on improving this macro, or a different one is
much appreciated.

Sincerely,
David Baber
 
L

Leon Mayne [MVP]

David said:
1. The Microsoft Outlook security box keeps coming up. Even after
setting the "Allow Access" to 10 minutes, it comes up after about
every 10 messages.

You could try something like Redemption (http://www.dimastr.com/redemption/)
to avoid the security dialogs
2. Anything with an RE or FW in the subject causes a blank file to be
created.

I think it might be the colon after the Re or FW that's causing the problem.
Do a find and replace for a colon on the subject string first.
 
D

David Baber

Leon,

I already extract almost all special characters. Reply's and Forwards
seem to put the original message into an attachment. Thinking that is
where the problem with that is.

Redemption looks nice, but the network security folks deem it an
unknown item and won't let me use it anywhere accept our test system.
Just need to find another way I guess.

Thanks for your time and help.

Sincerely,
David Baber
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top