S
Strader
Hello,
I need help to get the selected Mail Item in a C++ ALT Com Addin.
My Code so far
CComPtr<Outlook::MAPIFolder> mpFolder;
m_spExplorer->get_CurrentFolder(&mpFolder);
OlItemType pItem;
mpFolder->get_DefaultItemType(&pItem);
if(pItem == olMailItem)
{
CComPtr<Outlook::_MailItemPtr> spMailItem;
CComPtr<Outlook::Selection> spSelection;
m_spExplorer->get_Selection(&spSelection);
long itemsSelected;
spSelection->get_Count(&itemsSelected);
if(itemsSelected != 1)
return;
But I have a problem to cast the selected item in to a MailItem.
Any help is appreciated,
Thoma
I need help to get the selected Mail Item in a C++ ALT Com Addin.
My Code so far
CComPtr<Outlook::MAPIFolder> mpFolder;
m_spExplorer->get_CurrentFolder(&mpFolder);
OlItemType pItem;
mpFolder->get_DefaultItemType(&pItem);
if(pItem == olMailItem)
{
CComPtr<Outlook::_MailItemPtr> spMailItem;
CComPtr<Outlook::Selection> spSelection;
m_spExplorer->get_Selection(&spSelection);
long itemsSelected;
spSelection->get_Count(&itemsSelected);
if(itemsSelected != 1)
return;
But I have a problem to cast the selected item in to a MailItem.
Any help is appreciated,
Thoma