Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: attachment location

Geek News

attachment location
sophie 10/8/2008 9:19:01 AM
hi, all

I am working on attachment. I don't know how to get the location of a
sending email' attachment.

I want to do some operation before the email be sent.

is "Source Property" works? but when i use it like this
"objMailItem.attachments.Source" or "objMailItem.attachments.item(1).source",
it seems wrong.

pathName property seem work, but when i check the mail attachment item,
pathName is null.

i need help.

thanks.
RE: attachment location
Sue Mosher [MVP-Outlook] 10/8/2008 12:38:01 PM
A file attached to a message is contained in that message, in the Attachments
collection. Outlook neither knows nor cares about the original location of
the file, which may no longer even exist.

If you want to do some work on that file, you need to save it to the local
drive using the Attachment.SaveAsFile method. You can then modify the file,
remove the original attachment, and add the new version.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54




"sophie" wrote:

[Quoted Text]
> hi, all
>
> I am working on attachment. I don't know how to get the location of a
> sending email' attachment.
>
> I want to do some operation before the email be sent.
>
> is "Source Property" works? but when i use it like this
> "objMailItem.attachments.Source" or "objMailItem.attachments.item(1).source",
> it seems wrong.
>
> pathName property seem work, but when i check the mail attachment item,
> pathName is null.
>
> i need help.
>
> thanks.
RE: attachment location
sophie 10/9/2008 2:20:01 AM
Thanks sue.
I will try in this way.

"Sue Mosher [MVP-Outlook]" wrote:

[Quoted Text]
> A file attached to a message is contained in that message, in the Attachments
> collection. Outlook neither knows nor cares about the original location of
> the file, which may no longer even exist.
>
> If you want to do some work on that file, you need to save it to the local
> drive using the Attachment.SaveAsFile method. You can then modify the file,
> remove the original attachment, and add the new version.
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54
>
>
>
>
> "sophie" wrote:
>
> > hi, all
> >
> > I am working on attachment. I don't know how to get the location of a
> > sending email' attachment.
> >
> > I want to do some operation before the email be sent.
> >
> > is "Source Property" works? but when i use it like this
> > "objMailItem.attachments.Source" or "objMailItem.attachments.item(1).source",
> > it seems wrong.
> >
> > pathName property seem work, but when i check the mail attachment item,
> > pathName is null.
> >
> > i need help.
> >
> > thanks.

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net