Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

specific reciptient and i want automatic save the attachment to a file

1 view
Skip to first unread message

tw

unread,
Sep 10, 2002, 3:10:12 AM9/10/02
to
scenario:

every night a got a mail from a specific reciptient and i want automatic
save the attachment to a file.

how can i do that?

i have try to use Application_NewMail()

help

thanx


Karen Parker

unread,
Sep 11, 2002, 12:24:00 PM9/11/02
to
The Outlook Rules Wizard does not have the functionality to save attachments
of incoming mail. Therefore you will have to write your own rule. You can
use
the NewMail event as you indicated and perform all of the rule checking
there,
or you can use the Rules Wizard to target the specific message and then
perform
the saving of the attachments. Since the Rules Wizard can handle this
checking
for you, why not use it?

The following code will save the attachments of the incoming message
targeted
by the Rules Wizard:
Apply this rule after the message arrives
from <someone>
and which has an attachment
and on this machine only
run <Project1.getInboundMailAttachment>

Sub getInboundMailAttachment(objMail As MailItem)
Dim ma As Outlook.Attachment
For Each ma In objMail.Attachments
ma.SaveAsFile "C:\SomeFolder\" & ma.FileName
Next
Set ma = Nothing
End Sub

I hope the information that I provided here has been helpful to you.

Karen Parker
Microsoft, Developer Support Engineer - Windows Messaging / Outlook

Please do not send email directly to this alias. This alias is for
newsgroup purposes only.

Disclaimer: This posting is provided "AS IS" with no warranties, and
confers no rights.
--------------------
>Reply-To: "tw" <t...@addirect.se>
>From: "tw" <t...@addirect.se>
>Subject: specific reciptient and i want automatic save the attachment to a
file
>Date: Tue, 10 Sep 2002 09:10:12 +0200
>Lines: 14
>Organization: tw
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
>X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
>Message-ID: <uMYT0iJWCHA.1640@tkmsftngp11>
>Newsgroups: microsoft.public.office.developer.outlook.vba
>NNTP-Posting-Host: 195.163.28.131
>Path:
cpmsftngxa08!cppssbbsa01.microsoft.com!news-out.cwix.com!newsfeed.cwix.com!l
ogbridge.uoregon.edu!fr.usenet-edu.net!usenet-edu.net!newsfeed00.sul.t-onlin
e.de!t-online.de!tkmsftngp01!tkmsftngp11
>Xref: cpmsftngxa08 microsoft.public.office.developer.outlook.vba:8907
>X-Tomcat-NG: microsoft.public.office.developer.outlook.vba

tw

unread,
Sep 12, 2002, 3:33:22 AM9/12/02
to
thanks for the info karen.

i have a few question about this:

- i set a rule that check a mail when they arrive and have a attachment.
? but how i set the code so it trigger "getInboundMailAttachment"

// tw


"Karen Parker" <kaparker...@microsoft.com> wrote in message
news:MlmvC#aWCHA.2112@cpmsftngxa08...

0 new messages