How to call "Check Names" function in my program?

  • Thread starter Thread starter Alexander Chen
  • Start date Start date
A

Alexander Chen

I want to check if the mail addresses of recipients are valid and then
respose it according to the result in my program. The Tools menu has a menu
item "Check Names", I want to know if I can use this menu item's function in
my program.
 
I test Recipients.Resolve in my program, but found it could not do what i
need. For example, if I input a mail address (e-mail address removed) into the
RichEdit box, then I run this function, as a result, the address I just
input disappeared, , if I input "sgsgs", it disappeared too. Instead, if I
import mail addressed from contact lists, they would not disappeared. Why?


My code:

void CAddin::CheckName()
{
CComQIPtr<Outlook::_Inspector> spInspector;
CComQIPtr<Outlook::_MailItem> spMailItem;
CComQIPtr<Outlook::Recipients> spRecipients;
VARIANT_BOOL vSuc;


m_spApp->ActiveInspector(&spInspector);
spInspector->get_CurrentItem((IDispatch **)&spMailItem);
spMailItem->get_Recipients(&spRecipients);
spRecipients->ResolveAll(&vSuc);
}
 
Back
Top