B
B
I have written a COM addin to add a command bar along
with a menu item to MS Outlook. On clicking this menu item I am able to
identify the currently selected folder.
My approach is as follows:
void __stdcall CAddin::OnClickButton(/*IDispatch*/
Office::_CommandBarButton *Ctrl,VARIANT_BOOL * CancelDefault)
{
Outlook::MAPIFolder * m_pFolder;
CComQIPtr<Office::_CommandBarButton,&__uuidof(Office::_CommandBarButton)>
pCommandBarButton(Ctrl);
BSTR fullFolderPath;
CComQIPtr <Outlook::_Application> spApp(pApplication);
CComPtr<Outlook::_Explorer> spExplorer;
spApp->ActiveExplorer(&spExplorer);
spExplorer->get_CurrentFolder(& m_pFolder);
m_pFolder->get_FullFolderPath(& fullFolderPath);
}
What I intend to do is to retrieve certain properties of a mail that is
currently selected by the user when he clicks MyMenuButton.
Plz suggest me an approach as to how exactly I can get to know the
currently selected mail. Code snippets would be of great help.
with a menu item to MS Outlook. On clicking this menu item I am able to
identify the currently selected folder.
My approach is as follows:
void __stdcall CAddin::OnClickButton(/*IDispatch*/
Office::_CommandBarButton *Ctrl,VARIANT_BOOL * CancelDefault)
{
Outlook::MAPIFolder * m_pFolder;
CComQIPtr<Office::_CommandBarButton,&__uuidof(Office::_CommandBarButton)>
pCommandBarButton(Ctrl);
BSTR fullFolderPath;
CComQIPtr <Outlook::_Application> spApp(pApplication);
CComPtr<Outlook::_Explorer> spExplorer;
spApp->ActiveExplorer(&spExplorer);
spExplorer->get_CurrentFolder(& m_pFolder);
m_pFolder->get_FullFolderPath(& fullFolderPath);
}
What I intend to do is to retrieve certain properties of a mail that is
currently selected by the user when he clicks MyMenuButton.
Plz suggest me an approach as to how exactly I can get to know the
currently selected mail. Code snippets would be of great help.