![]() |
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
|
|||
|
|||
![]()
Hello,
I'm implementing Outlook COM add-in for MS Office 2003 SP2 with VC++ 6.0. A part of the functionality does the following: in NewInspector event of Inspectors collection obtained COM interface "insp" is used to get mail item edited by newly created inspector. In example I use mail item to set TO field. When in outlook Tools\Options\Mail Format\Use Microsoft Office Word is NOT checked everything works ok. But when I check this option and use MS Word as e-mail editor the sample code does not work correctly. All assignment to "TO" field are reflected in very first opened Word editor. It happened because "insp" parameter points to the same object in all cases when OnNewInspector event was fired (previously opened MS Word editors were not closed). void __stdcall CCarbonOutClient::OnNewInspector(Outlook::_Inspect or* insp) { ... IDispatch* pCurrentItem; CComPtrOutlook::_MailItem pMailItem; insp-get_CurrentItem(&pCurrentItem); HRESULT hr = pCurrentItem-QueryInterface(IID__MailItem, (void**)&pMailItem); ... pMailItem-TO = "Some Text"; } How I can overcome this problem? Is there any hot fix from Microsoft or some workaround? Thanks, Dennis. |
#2
|
|||
|
|||
![]()
What you may have to do Dennis is use an Inspector Wrapper to help with
your problem. Earlier Ken pointed me to an example in C#: http://www.outlookcode.com/codedetail.aspx?id=797 Hope this helps Dennis Masko wrote: Hello, I'm implementing Outlook COM add-in for MS Office 2003 SP2 with VC++ 6.0. A part of the functionality does the following: in NewInspector event of Inspectors collection obtained COM interface "insp" is used to get mail item edited by newly created inspector. In example I use mail item to set TO field. When in outlook Tools\Options\Mail Format\Use Microsoft Office Word is NOT checked everything works ok. But when I check this option and use MS Word as e-mail editor the sample code does not work correctly. All assignment to "TO" field are reflected in very first opened Word editor. It happened because "insp" parameter points to the same object in all cases when OnNewInspector event was fired (previously opened MS Word editors were not closed). void __stdcall CCarbonOutClient::OnNewInspector(Outlook::_Inspect or* insp) { ... IDispatch* pCurrentItem; CComPtrOutlook::_MailItem pMailItem; insp-get_CurrentItem(&pCurrentItem); HRESULT hr = pCurrentItem-QueryInterface(IID__MailItem, (void**)&pMailItem); ... pMailItem-TO = "Some Text"; } How I can overcome this problem? Is there any hot fix from Microsoft or some workaround? Thanks, Dennis. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem Printing Customized Outlook Form using Word Template | ajkim001 | Outlook - Using Forms | 15 | April 28th 06 06:28 PM |
can you add addresses in word documents automatically to outlo | Sue Manning-Jones | Outlook - Using Contacts | 5 | March 9th 06 10:19 PM |
outlook to word calendar add in | Alan Smithee Jr. | Outlook - General Queries | 6 | February 11th 06 11:41 PM |
Word is opening when I open Outlook | Mike McNicholas | Outlook - Installation | 4 | January 30th 06 04:23 AM |
Outlook with Word error | smags | Outlook - General Queries | 2 | January 22nd 06 08:32 PM |