PC Review


Reply
Thread Tools Rate Thread

Convert from IMailItem to IPostItem...

 
 
vinkal.chudgar@gmail.com
Guest
Posts: n/a
 
      27th Jul 2005
HI,

I have created a COM Addin in VC++/ATL.

I am using Outlook 2003.

when user press send button,OnSendMail function gets called.

OnSendMail function look like

OnSendMail(IDispatch* Ctrl,VARIANT_BOOL * CancelDefault)
{
CComQIPtr < Outlook::_MailItem > spMail(Ctrl); // works

CComQIPtr < Outlook::_PostItem > post(Ctrl); // not works



}

I would like to have PostItem Pointer but Outlook addin gives MailItem
Pointer.

I have also tried to convert mailItem Pointer to PostItem but it does
not work.

I want to have PostItem Pointer because i want to save mail in sent
state and MailItem Pointer does not provide this as SentOn Property is
readonly.



Is there any way to achieve it ?

regards,

vinkal

 
Reply With Quote
 
 
 
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      29th Jul 2005
Post items are never sent, they are posted. If you want the message in the
sent state, trap the MAPIFolder.Items.ItemAdd event (where MAPIFolder points
to the Sent Items folder). By that time the item is in the sent state and
its sender related properties are set.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> HI,
>
> I have created a COM Addin in VC++/ATL.
>
> I am using Outlook 2003.
>
> when user press send button,OnSendMail function gets called.
>
> OnSendMail function look like
>
> OnSendMail(IDispatch* Ctrl,VARIANT_BOOL * CancelDefault)
> {
> CComQIPtr < Outlook::_MailItem > spMail(Ctrl); // works
>
> CComQIPtr < Outlook::_PostItem > post(Ctrl); // not works
>
>
>
> }
>
> I would like to have PostItem Pointer but Outlook addin gives MailItem
> Pointer.
>
> I have also tried to convert mailItem Pointer to PostItem but it does
> not work.
>
> I want to have PostItem Pointer because i want to save mail in sent
> state and MailItem Pointer does not provide this as SentOn Property is
> readonly.
>
>
>
> Is there any way to achieve it ?
>
> regards,
>
> vinkal
>



 
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
Convert Columns of Sensitive Information, and then convert back... =?Utf-8?B?V2lsbGlhbSBFbGVyZGluZw==?= Microsoft Excel Programming 1 12th Oct 2006 09:37 PM
convert numbers to word like 100 convert to one hundred only =?Utf-8?B?QWJkdWwgTmFzYXI=?= Microsoft Excel Crashes 1 20th Jul 2006 12:11 PM
Convert file to binary, send it over the network, and convert it b =?Utf-8?B?Q2hld2ll?= Microsoft Dot NET 0 9th Sep 2005 06:04 PM
Convert file to binary, send it over the network, and convert it b =?Utf-8?B?Q2hld2ll?= Microsoft Dot NET Framework 1 9th Sep 2005 06:01 PM
convert decimal number to time : convert 1,59 (minutes, dec) to m =?Utf-8?B?YWdlbmRhOTUzMw==?= Microsoft Excel Misc 8 20th Jan 2005 10:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:43 PM.