T
Tom
Hi all,
I have a rather interesting issue with Outlook 2003. When a create a new
email message using automation outlook will crash if I try to request the
word editor(GetWordEditor) during the new inspector event.
***************************************
My settings
***************************************
1. I have Word selected as my default HTML editor. So every new message
uses word.
2. Every thing works perfect when I create a new message using Outlook menu
or new message button. (No Issues at all)
Here is the scenario the breaks.
***************************************
From button command in main window
***************************************
CComPtr<IDispatch> spDisp;
HRESULT hr = m_spApplication->raw_CreateItem(Outlook:lMailItem, &spDisp);
if(SUCCEEDED(hr) && spDisp)
{
CComPtr<Outlook::_MailItem> spMailItem;
hr = spDisp->QueryInterface(__uuidof(Outlook::_MailItem),
(LPVOID*)&spMailItem);
if(SUCCEEDED(hr) && spMailItem)
{
spMailItem->PutBodyFormat(Outlook:lFormatHTML);
// This will generate the "new" inspector event.
spMailItem->Display(_variant_t(true));
}
}
***************************************
In the new inspector
***************************************
if(m_spInspector->GetEditorType() == Outlook:lEditorWord)
m_bEditorIsWord = TRUE;
if(m_bEditorIsWord)
{
KABOOOOOM !!!!<<<<<<<<<<<<
KABOOOOOM !!!! The dispatch pointer is NULL!!! Uhg!!!!
}
IF I comment out the faulty lines of code -- surprisingly --- the new
message will invoke the HTML editor and NOT the word editor. STRANGE!! This
happens on every machine I have tested this on.
Has anybody run into this issue?
Thanks,
Tom -
I have a rather interesting issue with Outlook 2003. When a create a new
email message using automation outlook will crash if I try to request the
word editor(GetWordEditor) during the new inspector event.
***************************************
My settings
***************************************
1. I have Word selected as my default HTML editor. So every new message
uses word.
2. Every thing works perfect when I create a new message using Outlook menu
or new message button. (No Issues at all)
Here is the scenario the breaks.
***************************************
From button command in main window
***************************************
CComPtr<IDispatch> spDisp;
HRESULT hr = m_spApplication->raw_CreateItem(Outlook:lMailItem, &spDisp);
if(SUCCEEDED(hr) && spDisp)
{
CComPtr<Outlook::_MailItem> spMailItem;
hr = spDisp->QueryInterface(__uuidof(Outlook::_MailItem),
(LPVOID*)&spMailItem);
if(SUCCEEDED(hr) && spMailItem)
{
spMailItem->PutBodyFormat(Outlook:lFormatHTML);
// This will generate the "new" inspector event.
spMailItem->Display(_variant_t(true));
}
}
***************************************
In the new inspector
***************************************
if(m_spInspector->GetEditorType() == Outlook:lEditorWord)
m_bEditorIsWord = TRUE;
if(m_bEditorIsWord)
{
KABOOOOOM !!!!<<<<<<<<<<<<
KABOOOOOM !!!! The dispatch pointer is NULL!!! Uhg!!!!
}
IF I comment out the faulty lines of code -- surprisingly --- the new
message will invoke the HTML editor and NOT the word editor. STRANGE!! This
happens on every machine I have tested this on.
Has anybody run into this issue?
Thanks,
Tom -