A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

unable to save attachment-- Outlook 2003, C#



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 25th 07, 10:44 PM posted to microsoft.public.outlook.program_addins
Krishna
external usenet poster
 
Posts: 11
Default unable to save attachment-- Outlook 2003, C#

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.

Ads
  #2  
Old January 28th 07, 07:32 PM posted to microsoft.public.outlook.program_addins
spareway
external usenet poster
 
Posts: 11
Default unable to save attachment-- Outlook 2003, C#


Try using the ItemSend Event.

On Jan 25, 5:44 pm, "Krishna" wrote:[i]
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;
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.


  #3  
Old January 29th 07, 05:54 PM posted to microsoft.public.outlook.program_addins
Krishna
external usenet poster
 
Posts: 11
Default unable to save attachment-- Outlook 2003, C#

Currently I am using ItemSend event handler.
I am trying to save attachments in the mail-item-send event handler.



On Jan 28, 11:32 am, "spareway" wrote:[i]
Try using the ItemSend Event.

On Jan 25, 5:44 pm, "Krishna" wrote:



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;
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.- Hide quoted text -- Show quoted text -


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
save attachment in calendar jvl_runner Outlook - Calandaring 1 January 22nd 07 01:21 PM
unable to save any data (contacts, calendar, etc.) in Outlook 2002 dmendes Outlook - General Queries 1 November 21st 06 03:56 AM
Save Attachment Using Macro [email protected] Outlook and VBA 3 August 8th 06 03:42 PM
How do I save an outlook calendar to send as an attachment? blancogato Outlook - Calandaring 1 August 1st 06 03:54 AM
Save Meeting Request w/Attachment WordHazIt Outlook - Calandaring 2 July 21st 06 03:26 PM


All times are GMT +1. The time now is 04:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.