![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
I got it.
"Melbin" wrote: I have created my custom Message form. Now I want display my new custom form when a user open an existing Mail Message. I've write this code that caugth new inspector event: void __stdcall CSampleAddin::NewInspector(IDispatch* pdispInspector) { _Inspector *pInsp = (_Inspector *)pdispInspector; IDispatch *pCurrentItem; hr=pInsp-get_CurrentItem(&pCurrentItem); _MailItem *pMailItem = (_MailItem *) pCurrentItem; BSTR newMsgClass,oldMsgClass; _bstr_t newMsgClass_T (_T("IPM.Note.sampleform")); newMsgClass = newMsgClass_T.copy(); hr=pMailItem-put_MessageClass(newMsgClass); hr=pMailItem-Save(); CComPtr Outlook::_MailItem NewMailItem; hr=pMailItem-Copy((IDispatch**)&NewMailItem); hr=NewMailItem-Save(); hr=pMailItem-Delete(); hr=NewMailItem-Display(); } I noticed that if I don't follow this way, i.e. modify Message Class of item with default form, copy this item in a new item with My custom form, Save this new contact item and then delete old current item BUT if I only change the Message Class of current item, Outlook doesn't displays correctly the form (displays always the default form) . Now, with the above code when I double click on a mail message, outlook displays two forms: one default form and one My custom form. Why is that? I tried to use hr=pInsp-Close(olDiscard); and hr=pMailItem-Close(olDiscard); but then also i'm getting both the forms. Thanks a lotz in Advance, Melbin |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Get error message on opening Outlook profile. | Jeff Barnaby | Outlook - Installation | 0 | March 7th 06 08:15 PM |
Outlook opens Form as Email message, not Form | [email protected] | Outlook - General Queries | 2 | January 26th 06 09:54 PM |
some emails not opening, subject line only, not message | Bill | Outlook - General Queries | 4 | January 26th 06 01:31 PM |
opening new custom Message form | Melbin | Outlook - Using Forms | 2 | January 24th 06 12:16 PM |
error message when opening recurring appointment | paul | Outlook - Calandaring | 1 | January 11th 06 02:30 PM |