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

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.
 
A

Alexander Chen

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);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top