
January 12th 08, 02:16 PM
posted to microsoft.public.outlook.program_addins
|
|
New Inspector event in OL2000 when using Word as Editor
"Ken Slovak - [MVP - Outlook]" wrote:
Outlook 2007 implements the interface needed to be able to compare
Inspectors directly. Prior to that the only way really is to compare
properties on the 2 Inspectors. I use the window location and size, window
caption, and the EntryID of the item in the Inspector (null on unsaved
items). For checking WordMail I would use Inspector.CurrentItem.IsWordMail.
If you are running an Outlook COM addin you are running in-process with
Outlook and shouldn't use Sleep() and all Outlook references should run on
the main thread.
--
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
"xwjbs" wrote in message
...
I tried it . But i can't compare two inspector objects. So i really
replicate
it! Would you like to tell me how to compare them? Here is my code! It's
putted in a single thread ,not the main thread! I use sleep() so that it
works like a timer ! And i also try to use settimer(),but i can't compare
two
objects either!
......
struct Outlook::_Inspector* activeIn;
m_spApp-ActiveInspector(&activeIn);
if(NULL == activeIn)
continue;
CComPtrIUnknown activeUnk;
activeIn-QueryInterface(IID_IUnknown, (void**)&activeUnk);
struct Outlook::_Inspector* inspector;
CComPtrIUnknown spInspectUnk;
//IUnknown* spInspectUnk;
///*
for(long i=1;i=nNowNum;i++)
{
inspectors-Item(CComVariant(i),&inspector);
if(NULL == inspector || 0xcccccccc == (long)inspector)
continue;
inspector-IsWordMail(&bWordMail);
if(!bWordMail)
continue;
inspector-QueryInterface(IID_IUnknown, (void**)&spInspectUnk);
if(spInspectUnk.IsEqualObject(activeUnk))
{
//dosomething
//how to come in this block
}
}
........
|