PC Review


Reply
Thread Tools Rate Thread

Attachment not display in mail

 
 
Ashish
Guest
Posts: n/a
 
      18th Sep 2009
In outlook addin when i open a mail ActiveInspector_Activate event is
called. Here i add an attachment to this mail using MAPI. To add attachment
using MAPI
MapiSession->logon()
MapiMessage = MapiSession->GetMessage(entryid)
count = MapiMessage ->Attachment->Count
MapiMessage ->Attachment->Add(path)
MapiMessage ->Update();

count = MapiMessage ->Attachment->Count, new count returns one extra value.
it means attachment is added to mail but not display in mail. What should i
do to display attachment in open mail.


 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      18th Sep 2009
Outlook has no idea that you added something using another API, CDO 1.21 in
this case. Just use the Outlook object model to add the attachment, Outlook
will show that automatically.

You're already using the object model to handle the Inspector.Activate()
event, why drop into CDO? Especially since CDO is security restricted and
may not even be installed.


--
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)...
> In outlook addin when i open a mail ActiveInspector_Activate event is
> called. Here i add an attachment to this mail using MAPI. To add
> attachment using MAPI
> MapiSession->logon()
> MapiMessage = MapiSession->GetMessage(entryid)
> count = MapiMessage ->Attachment->Count
> MapiMessage ->Attachment->Add(path)
> MapiMessage ->Update();
>
> count = MapiMessage ->Attachment->Count, new count returns one extra
> value. it means attachment is added to mail but not display in mail. What
> should i do to display attachment in open mail.
>


 
Reply With Quote
 
Ashish
Guest
Posts: n/a
 
      18th Sep 2009
Actually i was trying to use CDO functions in active inspector.
Is it possible to avoid active inspector and open mail using MAPI. I mean
when we open a mail NewInspector is call which open a mail. Can we avoid
this and use MAPI to open mail.
"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Outlook has no idea that you added something using another API, CDO 1.21
> in this case. Just use the Outlook object model to add the attachment,
> Outlook will show that automatically.
>
> You're already using the object model to handle the Inspector.Activate()
> event, why drop into CDO? Especially since CDO is security restricted and
> may not even be installed.
>
>
> --
> 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)...
>> In outlook addin when i open a mail ActiveInspector_Activate event is
>> called. Here i add an attachment to this mail using MAPI. To add
>> attachment using MAPI
>> MapiSession->logon()
>> MapiMessage = MapiSession->GetMessage(entryid)
>> count = MapiMessage ->Attachment->Count
>> MapiMessage ->Attachment->Add(path)
>> MapiMessage ->Update();
>>
>> count = MapiMessage ->Attachment->Count, new count returns one extra
>> value. it means attachment is added to mail but not display in mail. What
>> should i do to display attachment in open mail.
>>

>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      18th Sep 2009
When you say MAPI do you mean CDO or Extended MAPI? Both Extended MAPI and
CDO aren't concerned with UI such as showing Inspectors.

I still have no idea why you are trying to complicate things that should be
very simple. Use the Outlook object model to add the attachment and Outlook
will immediately show it. No dropping into other API's required at all. Why
complicate things when they don't need to be? The KISS principle rules.

--
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)...
> Actually i was trying to use CDO functions in active inspector.
> Is it possible to avoid active inspector and open mail using MAPI. I mean
> when we open a mail NewInspector is call which open a mail. Can we avoid
> this and use MAPI to open mail.


 
Reply With Quote
 
ashish
Guest
Posts: n/a
 
      18th Sep 2009
> When you say MAPI do you mean CDO or Extended MAPI? Both Extended MAPI and
> CDO aren't concerned with UI such as showing Inspectors.


As per my knowledge Exchange CDO is on top of MAPI. Please correct me if i
am wrong.

> I still have no idea why you are trying to complicate things that should
> be very simple. Use the Outlook object model to add the attachment and
> Outlook will immediately show it. No dropping into other API's required at
> all. Why complicate things when they don't need to be? The KISS principle
> rules.


CDO has Message interface which provides Update function. Update allows to
save data on exchange permanently or dont save permanently.It means we can
modify a mail but do not update on exchange. but using outlook programming
if we modify a mail then data will update permanently on exchange. thats why
i asked about this.
I want to modify mail when open it and should not update on exchange. I read
on net it's possible using MAPI. thats why i tried this.
> 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)...
>> Actually i was trying to use CDO functions in active inspector.
>> Is it possible to avoid active inspector and open mail using MAPI. I mean
>> when we open a mail NewInspector is call which open a mail. Can we avoid
>> this and use MAPI to open mail.

>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      18th Sep 2009
As I said before, neither CDO nor Extended MAPI deal with UI such as
displaying items. If you want the display updated then use the Outlook
object model. If you don't want the attachment to persist then delete it
when you are done with it.

--
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)...
>> When you say MAPI do you mean CDO or Extended MAPI? Both Extended MAPI
>> and CDO aren't concerned with UI such as showing Inspectors.

>
> As per my knowledge Exchange CDO is on top of MAPI. Please correct me if i
> am wrong.
>
>> I still have no idea why you are trying to complicate things that should
>> be very simple. Use the Outlook object model to add the attachment and
>> Outlook will immediately show it. No dropping into other API's required
>> at all. Why complicate things when they don't need to be? The KISS
>> principle rules.

>
> CDO has Message interface which provides Update function. Update allows to
> save data on exchange permanently or dont save permanently.It means we can
> modify a mail but do not update on exchange. but using outlook programming
> if we modify a mail then data will update permanently on exchange. thats
> why i asked about this.
> I want to modify mail when open it and should not update on exchange. I
> read on net it's possible using MAPI. thats why i tried this.


 
Reply With Quote
 
Ashish
Guest
Posts: n/a
 
      19th Sep 2009
Correct when i delete attachment i need to save mail also. otherwise
attachments will written on exchange. and saving mail will modify mail date
on exchange. I think you have already explained mail date will modify in
this case. I was just trying if MAPI helps in this or not.
Thnaks
"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> As I said before, neither CDO nor Extended MAPI deal with UI such as
> displaying items. If you want the display updated then use the Outlook
> object model. If you don't want the attachment to persist then delete it
> when you are done with it.
>
> --
> 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)...
>>> When you say MAPI do you mean CDO or Extended MAPI? Both Extended MAPI
>>> and CDO aren't concerned with UI such as showing Inspectors.

>>
>> As per my knowledge Exchange CDO is on top of MAPI. Please correct me if
>> i am wrong.
>>
>>> I still have no idea why you are trying to complicate things that should
>>> be very simple. Use the Outlook object model to add the attachment and
>>> Outlook will immediately show it. No dropping into other API's required
>>> at all. Why complicate things when they don't need to be? The KISS
>>> principle rules.

>>
>> CDO has Message interface which provides Update function. Update allows
>> to save data on exchange permanently or dont save permanently.It means we
>> can modify a mail but do not update on exchange. but using outlook
>> programming if we modify a mail then data will update permanently on
>> exchange. thats why i asked about this.
>> I want to modify mail when open it and should not update on exchange. I
>> read on net it's possible using MAPI. thats why i tried this.

>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      21st Sep 2009
Given the behavior of the various API's you have to decide if your spec can
live with those behaviors or if you have to re-think your specs.

--
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)...
> Correct when i delete attachment i need to save mail also. otherwise
> attachments will written on exchange. and saving mail will modify mail
> date on exchange. I think you have already explained mail date will modify
> in this case. I was just trying if MAPI helps in this or not.
> Thnaks


 
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 when add to mail Ashish Microsoft Outlook Program Addins 10 18th Mar 2009 01:09 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.