Fixed font Subject: New Inspector word editor crash Outlook 2003
Author: Tom Date: 25 May 2010
References:
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::olMailItem, &spDisp);

if(SUCCEEDED(hr) && spDisp)
{
CComPtr<Outlook::_MailItem> spMailItem;
hr = spDisp->QueryInterface(__uuidof(Outlook::_MailItem),
(LPVOID*)&spMailItem);
if(SUCCEEDED(hr) && spMailItem)
{
spMailItem->PutBodyFormat(Outlook::olFormatHTML);

// This will generate the "new" inspector event.
spMailItem->Display(_variant_t(true));
}
}

***************************************
In the new inspector
***************************************
if(m_spInspector->GetEditorType() == Outlook::olEditorWord)
m_bEditorIsWord = TRUE;

if(m_bEditorIsWord)
{
KABOOOOOM !!!!
>>>>>>>CComPtr<IDispatch> spD = m_spInspector->GetWordEditor();
<<<<<<<<<<<<

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 -