PC Review


Reply
Thread Tools Rate Thread

Attachment not display when add to mail

 
 
Ashish
Guest
Posts: n/a
 
      16th Mar 2009
I add an attachment to mail when open the mail in outlook. When i double
click on a mail then attachment display in mail.But when i right click on
mail select Open then i cant see the attachment while if i click on
File->Save Attachments then it shows me the attachment name. Which property
need to set to display the attachment


 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      16th Mar 2009
Show the code you use. Are you saving the item after you add the attachment?

--
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


"Ashish" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I add an attachment to mail when open the mail in outlook. When i double
>click on a mail then attachment display in mail.But when i right click on
>mail select Open then i cant see the attachment while if i click on
>File->Save Attachments then it shows me the attachment name. Which property
>need to set to display the attachment
>


 
Reply With Quote
 
Ashish
Guest
Posts: n/a
 
      16th Mar 2009
No. I dont save the the item after adding attachment.
I add the attachment in Item_Open() eveny
item->Attachments->Add(filaname);
When i double click a mail attachment display in mail. WHen i right click
and select open then it's not display.
"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Show the code you use. Are you saving the item after you add the
> attachment?
>
> --
> 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
>
>
> "Ashish" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I add an attachment to mail when open the mail in outlook. When i double
>>click on a mail then attachment display in mail.But when i right click on
>>mail select Open then i cant see the attachment while if i click on
>>File->Save Attachments then it shows me the attachment name. Which
>>property need to set to display the attachment
>>

>



 
Reply With Quote
 
Ashish
Guest
Posts: n/a
 
      16th Mar 2009
I dont save item when i open it. But in my outlook addin when i open a item
and add an attachment in item_open many item events called like item_open,
item_write, item_read, item_attachmentadd,item_beforeattachmentsave etc
If i disable item_write( avoid writing) then it other events for this item
are stop. Should i disable item_write. But if i disable it then how to
enable other events.
"Ashish" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> No. I dont save the the item after adding attachment.
> I add the attachment in Item_Open() eveny
> item->Attachments->Add(filaname);
> When i double click a mail attachment display in mail. WHen i right click
> and select open then it's not display.
> "Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Show the code you use. Are you saving the item after you add the
>> attachment?
>>
>> --
>> 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
>>
>>
>> "Ashish" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>I add an attachment to mail when open the mail in outlook. When i double
>>>click on a mail then attachment display in mail.But when i right click on
>>>mail select Open then i cant see the attachment while if i click on
>>>File->Save Attachments then it shows me the attachment name. Which
>>>property need to set to display the attachment
>>>

>>

>
>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      16th Mar 2009
Don't disable the other events and try saving the item after you add the
attachment.

--
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


"Ashish" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I dont save item when i open it. But in my outlook addin when i open a item
>and add an attachment in item_open many item events called like item_open,
>item_write, item_read, item_attachmentadd,item_beforeattachmentsave etc
> If i disable item_write( avoid writing) then it other events for this item
> are stop. Should i disable item_write. But if i disable it then how to
> enable other events.
> "Ashish" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> No. I dont save the the item after adding attachment.
>> I add the attachment in Item_Open() eveny
>> item->Attachments->Add(filaname);
>> When i double click a mail attachment display in mail. WHen i right click
>> and select open then it's not display.


 
Reply With Quote
 
Ashish
Guest
Posts: n/a
 
      17th Mar 2009
I have tried to save item after adding attachment but it still dont display
attachment. I'm not saving item before adding attachment. I dont have much
knowledge for outlook addin. I think it is happening due to following
reason.

In my addin Open a mail from inbox folder(subject-> test1) add an attachment
in item_open event and save this mail(test1.msg type) on hard
disk(File->SaveAs) and close. Now Open test1.msg from hard disk(since
test1.msg is also in Inbox folder, item_open event call 2 times). After
closing this mail i found 2 mails of subject test1.msg in inbox folder. I am
handling all mail events throgh Inspector.

When i open a mail
register inspector event in a inspector class and pass
Application->CurrentInspector
In Notify of inspector class register mail event(outlook::Items)

Please suggest where i'm wrong

"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Don't disable the other events and try saving the item after you add the
> attachment.
>
> --
> 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
>
>
> "Ashish" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I dont save item when i open it. But in my outlook addin when i open a
>>item and add an attachment in item_open many item events called like
>>item_open, item_write, item_read,
>>item_attachmentadd,item_beforeattachmentsave etc
>> If i disable item_write( avoid writing) then it other events for this
>> item are stop. Should i disable item_write. But if i disable it then how
>> to enable other events.
>> "Ashish" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> No. I dont save the the item after adding attachment.
>>> I add the attachment in Item_Open() eveny
>>> item->Attachments->Add(filaname);
>>> When i double click a mail attachment display in mail. WHen i right
>>> click and select open then it's not display.

>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      17th Mar 2009
Why are you saving the item as a MSG file and then re-opening it when you
already have that item saved in Outlook? What you are doing makes no sense
to me.

--
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


"Ashish" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have tried to save item after adding attachment but it still dont display
>attachment. I'm not saving item before adding attachment. I dont have much
>knowledge for outlook addin. I think it is happening due to following
>reason.
>
> In my addin Open a mail from inbox folder(subject-> test1) add an
> attachment in item_open event and save this mail(test1.msg type) on hard
> disk(File->SaveAs) and close. Now Open test1.msg from hard disk(since
> test1.msg is also in Inbox folder, item_open event call 2 times). After
> closing this mail i found 2 mails of subject test1.msg in inbox folder. I
> am handling all mail events throgh Inspector.
>
> When i open a mail
> register inspector event in a inspector class and pass
> Application->CurrentInspector
> In Notify of inspector class register mail event(outlook::Items)
>
> Please suggest where i'm wrong


 
Reply With Quote
 
Ashish
Guest
Posts: n/a
 
      17th Mar 2009
I just tell this only for knowing the reason why attachment not display.
Ok If i dont save item as msg and reopen it then i still have the save
problem for attachment(right click on a item and select open).

"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Why are you saving the item as a MSG file and then re-opening it when you
> already have that item saved in Outlook? What you are doing makes no sense
> to me.
>
> --
> 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
>
>
> "Ashish" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I have tried to save item after adding attachment but it still dont
>>display attachment. I'm not saving item before adding attachment. I dont
>>have much knowledge for outlook addin. I think it is happening due to
>>following reason.
>>
>> In my addin Open a mail from inbox folder(subject-> test1) add an
>> attachment in item_open event and save this mail(test1.msg type) on hard
>> disk(File->SaveAs) and close. Now Open test1.msg from hard disk(since
>> test1.msg is also in Inbox folder, item_open event call 2 times). After
>> closing this mail i found 2 mails of subject test1.msg in inbox folder. I
>> am handling all mail events throgh Inspector.
>>
>> When i open a mail
>> register inspector event in a inspector class and pass
>> Application->CurrentInspector
>> In Notify of inspector class register mail event(outlook::Items)
>>
>> Please suggest where i'm wrong

>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      17th Mar 2009
There should be no difference in how an item displays no matter how it's
opened.

You never did show any of your code, so no one knows what you are doing or
how.

Assuming you want to add an attachment when an item is opened then the way
I'd do it would be something like this, in the first Inspector.Activate()
event, assuming that _inspector is your Inspector object:

Outlook.MailItem mail = _inspector.CurrentItem;
Outlook.Attachments attachs = mail.Attachments;

Outlook.Attachment attach = attachs.Add(
"c:\foobar.jpg", (int)Outlook.OlAttachmentType.olByValue, 1,"My
Attachment Picture");

mail.Save();

// now release all those objects
--
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


"Ashish" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I just tell this only for knowing the reason why attachment not display.
> Ok If i dont save item as msg and reopen it then i still have the save
> problem for attachment(right click on a item and select open).


 
Reply With Quote
 
Ashish
Guest
Posts: n/a
 
      18th Mar 2009
Thanks it's solved now. The problem was adding attachment in Item_Open
event. When i add attachment in Inspector.Activate() then it display.

I know how to use mail item event like item_open, item_close,item_fwd etc.
But i dont have idea how to implement context menu operations like when i
right click on any mail select any opertion like reply,forward etc. Are they
handled seperately
"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> There should be no difference in how an item displays no matter how it's
> opened.
>
> You never did show any of your code, so no one knows what you are doing or
> how.
>
> Assuming you want to add an attachment when an item is opened then the way
> I'd do it would be something like this, in the first Inspector.Activate()
> event, assuming that _inspector is your Inspector object:
>
> Outlook.MailItem mail = _inspector.CurrentItem;
> Outlook.Attachments attachs = mail.Attachments;
>
> Outlook.Attachment attach = attachs.Add(
> "c:\foobar.jpg", (int)Outlook.OlAttachmentType.olByValue, 1,"My
> Attachment Picture");
>
> mail.Save();
>
> // now release all those objects
> --
> 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
>
>
> "Ashish" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I just tell this only for knowing the reason why attachment not display.
>> Ok If i dont save item as msg and reopen it then i still have the save
>> problem for attachment(right click on a item and select open).

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Photo Attachment Display - Why done in Windows-Mail but not Outloo Shaan Microsoft Outlook Discussion 1 8th Mar 2010 03:56 PM
Attachment not display in mail Ashish Microsoft Outlook Program Addins 7 21st Sep 2009 02:05 PM
When Replying To An E-Mail With Attachment, The Text Goes But NotThe Attachment. Morton Windows Vista Mail 3 28th May 2008 01:48 AM
opening mail attachment attachment in Outlook? =?Utf-8?B?SnVsaW8=?= Microsoft Outlook Discussion 1 27th Mar 2005 06:10 AM
e-mail with an attachment after opening the attachment, when clos. =?Utf-8?B?Q296?= Microsoft Outlook Discussion 6 17th Dec 2004 03:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:46 PM.