Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / January 2007

Tip: Looking for answers? Try searching our database.

unable to save attachment-- Outlook 2003, C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Krishna - 25 Jan 2007 22:44 GMT
Hi,
I am developing a plug-in to Outlook 2003 using C#.

I am trying to save attachments in the mail-item-send event handler.
If the mail-item has ordinary attachments, like when user clicks Attach
button, I am able to save them. But, if the mail-item has attachment as
a result of an inline image(user copy-paste an image to mail body) I
get a COM exeption, with the message:

"Cannot save the attachment. Cannot add the attachment; no data source
was provided."

my code to save attachment is something like this:

Ol.Attachment Attachment =  mi.Attachment[i];
String myDir = "C:\\EmailAttachments";
String myfullName = myDir + "\\" + Attachment.FileName;

try
{
Attachment.SaveAsFile(myfullName);
}
catch(Exception ex)
{
....
}

Can someone help me with this problem.  If its not possible for me to
save the Attachment in the send-mail event handler, is there any
work-around.

Thanks,
Krishna.
spareway - 28 Jan 2007 19:32 GMT
Try using the ItemSend Event.

> Hi,
> I am developing a plug-in to Outlook 2003 using C#.
[quoted text clipped - 26 lines]
> Thanks,
> Krishna.
Krishna - 29 Jan 2007 17:54 GMT
Currently I am using ItemSend event handler.
> > I am trying to save attachments in the mail-item-send event handler.

> Try using the ItemSend Event.
>
[quoted text clipped - 28 lines]
> > Thanks,
> > Krishna.- Hide quoted text -- Show quoted text -
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.