(Msg. 2) Posted: Wed Oct 08, 2008 5:38 am
Post subject: RE: attachment location [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
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.
(Msg. 3) Posted: Wed Oct 08, 2008 7:20 pm
Post subject: RE: attachment location [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Thanks sue.
I will try in this way.
"Sue Mosher [MVP-Outlook]" wrote:
> 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.
(Msg. 4) Posted: Tue Jan 06, 2009 7:23 pm
Post subject: RE: attachment location [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Hi Sue,
The SaveAsFile method works for normail emails. However, when I try to
execute this method on inline attachments (namely, images), I get the
following error:
"Cannot save the attachment. Cannot add the attachment; no data source was
provided."
Could you shed some light on why this is so, and how can I overcome it? Many
thanks in advance.
"Sue Mosher [MVP-Outlook]" wrote:
> 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.
(Msg. 5) Posted: Wed Jan 07, 2009 9:20 am
Post subject: Re: attachment location [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Sue's not available.
In that case there is nothing to go on for Outlook and most likely the
Attachment fields such as PR_ATTACH_FILENAME and such are blank. Are these
images or embedded Outlook objects? In any case about all you could do on a
low level would be to try to extract the attachment binary data and save
that out but you wouldn't know the file type or correct file format so that
wouldn't do much good at all.
"khai" <khai.RemoveThis@discussions.microsoft.com> wrote in message
news:A01308F5-C069-4242-B7C2-D1A0EBA08B9A@microsoft.com...
> Hi Sue,
>
> The SaveAsFile method works for normail emails. However, when I try to
> execute this method on inline attachments (namely, images), I get the
> following error:
>
> "Cannot save the attachment. Cannot add the attachment; no data source was
> provided."
>
> Could you shed some light on why this is so, and how can I overcome it?
> Many
> thanks in advance.
(Msg. 6) Posted: Fri Jan 09, 2009 2:53 am
Post subject: Re: attachment location [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
They are actually inline images. When I try to get the Type, it returns
olByValue.
I realise that I encounter this problem if I use Word 2003 to edit the email
messages (i.e. checkbox found under Tools -> Options -> Mail Format ->
Message Format).
Is there a work around, to ensure that inline images will be saved correctly
even if Word 2003 is chosen as the editor?
"Ken Slovak - [MVP - Outlook]" wrote:
> Sue's not available.
>
> In that case there is nothing to go on for Outlook and most likely the
> Attachment fields such as PR_ATTACH_FILENAME and such are blank. Are these
> images or embedded Outlook objects? In any case about all you could do on a
> low level would be to try to extract the attachment binary data and save
> that out but you wouldn't know the file type or correct file format so that
> wouldn't do much good at all.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com > Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm >
>
> "khai" <khai DeleteThis @discussions.microsoft.com> wrote in message
> news:A01308F5-C069-4242-B7C2-D1A0EBA08B9A@microsoft.com...
> > Hi Sue,
> >
> > The SaveAsFile method works for normail emails. However, when I try to
> > execute this method on inline attachments (namely, images), I get the
> > following error:
> >
> > "Cannot save the attachment. Cannot add the attachment; no data source was
> > provided."
> >
> > Could you shed some light on why this is so, and how can I overcome it?
> > Many
> > thanks in advance.
>
>
(Msg. 7) Posted: Fri Jan 09, 2009 9:36 am
Post subject: Re: attachment location [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
"khai" <khai.TakeThisOut@discussions.microsoft.com> wrote in message
news:76D85CF6-06BB-4C71-8DA6-A8DEC7FBF70D@microsoft.com...
> They are actually inline images. When I try to get the Type, it returns
> olByValue.
>
> I realise that I encounter this problem if I use Word 2003 to edit the
> email
> messages (i.e. checkbox found under Tools -> Options -> Mail Format ->
> Message Format).
>
> Is there a work around, to ensure that inline images will be saved
> correctly
> even if Word 2003 is chosen as the editor?
(Msg. 8) Posted: Wed Feb 04, 2009 11:42 pm
Post subject: Re: attachment location [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Im still stuck on this problem. It is definitely not possible to force users
to not use inline images as it would be an "un-friendly restriction" to
impose on the users.
I have found out that if Word is being used as the editor, the filename of
the attachment is automatically converted to something else i.e.
image001.jpg, as compared to the actual name of the file when Word is not
being used as the editor. Could this be the reason why the "Cannot save
attachment. Cannot add attachment; no data source was provided" error was
returned?
"Ken Slovak - [MVP - Outlook]" wrote:
> Not really other than not using inline images.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com > Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm >
>
> "khai" <khai RemoveThis @discussions.microsoft.com> wrote in message
> news:76D85CF6-06BB-4C71-8DA6-A8DEC7FBF70D@microsoft.com...
> > They are actually inline images. When I try to get the Type, it returns
> > olByValue.
> >
> > I realise that I encounter this problem if I use Word 2003 to edit the
> > email
> > messages (i.e. checkbox found under Tools -> Options -> Mail Format ->
> > Message Format).
> >
> > Is there a work around, to ensure that inline images will be saved
> > correctly
> > even if Word 2003 is chosen as the editor?
>
>
All times are: Eastern Time (US & Canada) (change) Goto page 1, 2
Page 1 of 2
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum