Ok many thanks, now it works. Another little question on inspectors... when
I got an active Inspector it is possible to easily obtain an object (a combo
box) on a custom toolbar? I don't want to store every toolbar object in
memory, so when I got an active Inspector I would obtain a toolbar object in
the current inspector dinamically (a toolbar object is just a button or a
combo box) .
....
CComQIPtr <Office::_CommandBarComboBox> spCombo;
CComQIPtr <Outlook::_Inspector> spInspector;
CComPtr<Office::_CommandBars> spCmdBars;
CComPtr<Office::CommandBar> spCmdBar; <<-- the combo is previously added on
a local variable (spCmdBar)
string comboBoxText ="";
m_spApp->ActiveInspector(&spInspector);
if (!spInspector)
return comboBoxText; //return an empty string
spInspector->get_CommandBars(&spCmdBars);
spCmdBars->FindControl(???) or I should use pCmdBars->get_SOME method?
//... ????
//when I got the combo box object I should extract its selected text
BSTR bstrText;
spCombo->get_Text(&bstrText);
comboBoxText = bstrText; //convert BSTR to string
Andrea