Attachment not display when add to mail

Status
Not open for further replies.
A

Ashish

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
 
Show the code you use. Are you saving the item after you add the attachment?

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:OPXo9iipJHA.3896@TK2MSFTNGP04.phx.gbl...
> 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
>
 
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.
<kenslovak@mvps.org> wrote in message

news:%23QrfHDkpJHA.1288@TK2MSFTNGP02.phx.gbl...
> Show the code you use. Are you saving the item after you add the
> attachment?

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:OPXo9iipJHA.3896@TK2MSFTNGP04.phx.gbl...
> >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
> >

>
 
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" <akohli_2004@hotmail.com> wrote in message

news:%23hBMbSkpJHA.1168@TK2MSFTNGP05.phx.gbl...
> 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.
> " - " <kenslovak@mvps.org> wrote in message
> news:%23QrfHDkpJHA.1288@TK2MSFTNGP02.phx.gbl...
> > Show the code you use. Are you saving the item after you add the
> > attachment?
>

>> > >

> >

>

>
>
>
>
>
>> "Ashish" <akohli_2004@hotmail.com> wrote in message
> > news:OPXo9iipJHA.3896@TK2MSFTNGP04.phx.gbl...
> >>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
> >>

> >


>
 
Don't disable the other events and try saving the item after you add the

attachment.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:eNMgzzkpJHA.1340@TK2MSFTNGP06.phx.gbl...
> 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" <akohli_2004@hotmail.com> wrote in message
> news:%23hBMbSkpJHA.1168@TK2MSFTNGP05.phx.gbl...
> > 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.
 
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
<kenslovak@mvps.org> wrote in message

news:%237aNMTnpJHA.1340@TK2MSFTNGP06.phx.gbl...
> Don't disable the other events and try saving the item after you add the
> attachment.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:eNMgzzkpJHA.1340@TK2MSFTNGP06.phx.gbl...
> >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" <akohli_2004@hotmail.com> wrote in message
> > news:%23hBMbSkpJHA.1168@TK2MSFTNGP05.phx.gbl...
> >> 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.

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

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:Ok7zQstpJHA.5508@TK2MSFTNGP05.phx.gbl...
> 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
 
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).
<kenslovak@mvps.org> wrote in message

news:O5MYRMwpJHA.2124@TK2MSFTNGP05.phx.gbl...
> 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.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:Ok7zQstpJHA.5508@TK2MSFTNGP05.phx.gbl...
> >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

>
 
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

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:eI54RtwpJHA.3380@TK2MSFTNGP04.phx.gbl...
> 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).
 
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
<kenslovak@mvps.org> wrote in message

news:OLV6yA0pJHA.5100@TK2MSFTNGP03.phx.gbl...
> 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
> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:eI54RtwpJHA.3380@TK2MSFTNGP04.phx.gbl...
> >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).

>
 
What version of Outlook? For Outlook 2007 you have various new context menu

events on the Application object that you can handle and a shared event for

when a context menu closes. There are separate events for folder, item,

attachment, shortcuts, etc.

For earlier versions of Outlook there is nothing like that and you have to

use hacks that mostly work but don't tell you what was right-clicked or

where in the Outlook design surface. Examples of the hacks and various

problems that can arise are at http://www.outlookcode.com. Search there on

"context menu".

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:%23L3PfS7pJHA.4540@TK2MSFTNGP04.phx.gbl...
> 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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
A Attachment not display in mail Outlook VBA and Custom Forms 7
S Paperclip icon shows without attachment in email under Sent folder Using Outlook 0
M "Attachment Detacher for Outlook" add in, does it update the server copy of the email? Using Outlook 1
C Code to move mail with certain attachment name? Does Not work Outlook VBA and Custom Forms 3
kkqq1122 How would I add Search for attachment name Outlook VBA and Custom Forms 3
Owl Export Outlook PDF Attachment as JPG? Outlook VBA and Custom Forms 4
Timmon Remove just one attachment before AutoForward Outlook VBA and Custom Forms 0
P File Picker for attachment Outlook VBA and Custom Forms 0
D Forwarding email based on the attachment file type and specific text found on the attachment file name Outlook VBA and Custom Forms 1
N File Picker for attachment Outlook VBA and Custom Forms 2
G print attachment straight away; working script edit not working Outlook VBA and Custom Forms 0
G Save attachment run a script rule Outlook VBA and Custom Forms 0
M Autoforward just attachment OR just body. Outlook VBA and Custom Forms 0
D Create new email from the received Email Body with attachment Outlook VBA and Custom Forms 10
T vba extract data from msg file as attachment file of mail message Outlook VBA and Custom Forms 1
K Outlook Office 365 VBA download attachment Outlook VBA and Custom Forms 2
P Sending email from outlook IMAP to GMAIL where embedded images are added as attachment Using Outlook 1
S save attachment with date & time mentioned inside the file Outlook VBA and Custom Forms 0
O VBA Outlook Message Attachment - Array Index Out of Bounds Outlook VBA and Custom Forms 0
A Edit attachment Save and Reply Outlook VBA and Custom Forms 0
D Move Email with Attachment to Folder Outlook VBA and Custom Forms 3
B Outlook 2010 Opening Mail Attachment Using Outlook 2
A Warning When Opening attachment Using Outlook 7
R Limiting length of saved attachment in VBA Outlook VBA and Custom Forms 2
F Script for zip file attachment Outlook VBA and Custom Forms 1
P Outlook 2013 Word Share doc as Email Attachment now brings up Eudora. Using Outlook 1
L Attachment saving and tracking - PLEASE help! Outlook VBA and Custom Forms 5
H Outlook 2003 find by "has attachment" Using Outlook 1
9 Outlook 2016 How to save an Outlook attachment to a specific folder then delete the email it came from? Using Outlook 1
J Add an Attachment Using an Array and Match first 17 Letters to Matching Template .oft to Send eMail Outlook VBA and Custom Forms 2
geofferyh Cannot get Macro to SAVE more than one message attachment??? Outlook VBA and Custom Forms 5
geofferyh How to change the Attachment File Name? Outlook VBA and Custom Forms 1
geofferyh Outlook 2010 How to Copy Outlook Attachment to a Specific Folder? Outlook VBA and Custom Forms 3
D Body text of email disappears when I scan an attachment from printer to email Using Outlook 1
J Help Please!!! Outlook 2016 - VBA Macro for replying with attachment in meeting invite Outlook VBA and Custom Forms 9
W Save Outlook attachment in network folder and rename to current date and time Outlook VBA and Custom Forms 18
D Autosave Attachment and Rename Outlook VBA and Custom Forms 1
N Macro for attachment saved and combine Outlook VBA and Custom Forms 1
Andrew Quirl Open attachment, manipulate without add-on program? Outlook VBA and Custom Forms 5
V VB script code to save a specific email attachment from a given email Outlook VBA and Custom Forms 14
Commodore Attachment icon when there is no attachment Using Outlook 3
V Saving attachment from outlook in My Documents Outlook VBA and Custom Forms 14
N automatic response with an attachment based on the subject line Outlook VBA and Custom Forms 1
J Auto Forward - Include Attachment and change Subject depending on original sender Outlook VBA and Custom Forms 3
M Search for attachment filename Using Outlook 0
E Open olNoteItem Attachment Outlook VBA and Custom Forms 6
Vijay Reply all by attachment name Using Outlook 10
Michael R Belleville Making an Attachment Name the Message Subject Using Outlook 2
N Paste content to Excel when .txt file (attachment) is opened Outlook VBA and Custom Forms 1
P Outlook Randomly Not attaching (attachment file) Using Outlook 0

Similar threads

Back
Top