How can I save an attachment that is an email to my inbox?

G

Guest

I would like to automate a workaround, but have no idea where to start. The
workaround is needed due to the following scenario:

I am working on a site where I cannot access my corporate email account. I
set up a rule to redirect my mail to my client email address, but noticed
that I did not see who was also sent the email (either as To or CC). So I
changed to rule to forward the message as an attachment so that I can see all
recipients as well as having their email addresses (which you do not get if
you just forward the email).

I would like a now like a macro to run automatically when mail arrives that
has been forwarded from my corporate email address. The macro would copy the
email attachment to my inbox and then delete the forwarded message. All I
can see in the VBA help is to save attachments to the file system, but I know
that I can drag and drop the email attachment from the forwarded message into
my inbox manually.

Any help is much appreciated, as I have never written VBA in Outlook and
only a little in Excel.
 
M

Michael Bauer

Am Tue, 11 Apr 2006 09:24:53 -0700 schrieb matt69:

In fact, saving the attachment as a file is the first step. You then can
open that message via GetItemFromTemplate and copy it into any folder.
 
D

Dmitry Streblechenko

Note however that Application.CreateItemFromTemplate will wipe out all the
sender related properties since CreateItemFromTemplate is meant to be used
as a template for sending a new message.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
M

Michael Bauer

Am Wed, 12 Apr 2006 12:10:15 -0700 schrieb Dmitry Streblechenko:

Oh, I never realized that...

Is it possible to add the attachment as an embedded item and open it with
Redemption using the PR_ATTACH_DATA_OBJ property?
 
D

Dmitry Streblechenko

Sure, Attachment.EmbeddedMsg will return MessageItem in case of the
Safe*Item objects and RDOMail in case of an attachment from an RDOMail
object.
You can then copy that message to any folder.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
M

Michael Bauer

Am Thu, 13 Apr 2006 09:37:20 -0700 schrieb Dmitry Streblechenko:

Thanks Dmitry.

So Matt69, the Redemption from www.dimastr.com provides you with a solution.
 

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