M
Maneesh S
I have created a Outlook addin in C++, that works fine except when Word is
the emaileditor. The addin shows up in Word as well as Outlook. I do not want
to show the addin in Word. For a workaround I have added the following code
(In outlook code where addin is added) which seem to have solved the issue of
showing the addin toolbar in Word but this have caused another glitch in the
addin. In Outlook, the addin toolbar is not visible by default, I have to
select the toolbar from the right click menu to make it visible on the email
editor(When Word is the mail editor). On more investigation I have found out
that it is failing at pdoc->putVisible(VARIANT_TRUE);
my code below.
CComQIPtr<Outlook::_Inspector> pOlInspector(pOutlook_Inspector);
if (pOlInspector->IsWordMail())
{
CComPtr<Word::_Document> pDoc = NULL;
pDoc = (Word::_DocumentPtr) pOlInspector->WordEditor;
pDoc->Application->CustomizationContext = pDoc;
pWordDoc->Save();
}
//Add my toolbar here and make the toolbar visible
pMyToolbar->putVisible(VARIANT_TRUE); //failing at this, get an E_FAIL error.
I also found out that when Word is not my editor for outlook, in my New
email my custom Addin menu item is added under Actions instead of Tools. But
when I close the compose window and compose a new email this time the same
addin menu item is created under Tools.
Any suggestion will be higly appreciated.
Thanks
Maneesh Singh
the emaileditor. The addin shows up in Word as well as Outlook. I do not want
to show the addin in Word. For a workaround I have added the following code
(In outlook code where addin is added) which seem to have solved the issue of
showing the addin toolbar in Word but this have caused another glitch in the
addin. In Outlook, the addin toolbar is not visible by default, I have to
select the toolbar from the right click menu to make it visible on the email
editor(When Word is the mail editor). On more investigation I have found out
that it is failing at pdoc->putVisible(VARIANT_TRUE);
my code below.
CComQIPtr<Outlook::_Inspector> pOlInspector(pOutlook_Inspector);
if (pOlInspector->IsWordMail())
{
CComPtr<Word::_Document> pDoc = NULL;
pDoc = (Word::_DocumentPtr) pOlInspector->WordEditor;
pDoc->Application->CustomizationContext = pDoc;
pWordDoc->Save();
}
//Add my toolbar here and make the toolbar visible
pMyToolbar->putVisible(VARIANT_TRUE); //failing at this, get an E_FAIL error.
I also found out that when Word is not my editor for outlook, in my New
email my custom Addin menu item is added under Actions instead of Tools. But
when I close the compose window and compose a new email this time the same
addin menu item is created under Tools.
Any suggestion will be higly appreciated.
Thanks
Maneesh Singh