contact won't resolve?

D

Dale

All

I have a VBA module I copied from the internet and modified it to do what I
needed. Sorry, I don't remember who provided it (but thanks whoever you
were).

Anyway, here is the bit that seems to be causing some trouble.

For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next


This code seems to be kind of hit and miss. When it works - it works well.

But, certain contacts, which I know I have in my address book, will not
resolve. In the "To" field of the email, I get a red underline. In my
reading, I believe that meant the name was not in the address book. I've
double and triple checked spelling but I can't seem to make it work.

Does anyone have a clue what might be causing this situation?

Thanx in advance
Dale
 
D

Dmitry Streblechenko

Does the contact in question reside in a contacts folder visible in the
Outlook Address Book?
Is there a chance that you have duplicate/ambiguous contacts? What happens
when you hit Ctrl+K after you type the name of the contact in question in
the To edit box in Outlook?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
D

Dale

Dmitry

Question #1 answer. I guess so, if I go to the contacts folder and right
click on it, then select properties, under the Outlook Address Book tab, the
name of the address book is "Contacts". Hope that answers your question.

Question #2

I think the control K action may indicate something. I get 2 entries. The
email address and also the Business fax such as this:

Name Email Type
Dale Jones SMTP
Dale Jones (Business Fax) FAX

What I can't figure out is there is only one contact in the address book. I
do have a Fax phone number typed in for that person however.

What's going on?

Regards
Dale
 
D

Dmitry Streblechenko

This is absolutely normal - OAB exposes each of Email1, Email2, Email3 and
FAX addresses as a separate entry.
When you type the name of the address, OAB has no idea which address exactly
you want to use - they both are valid.
If you know the SMTP address, use it instead of thee contact name - it can
always be resolved to a one-off entry.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
D

Dale

Thanx Dimity

I was afraid of that. Well what about this?

I gather the name to be resolved via Word automation from an email
"coversheet" so to speak. If the client approves, he/she will print and
sign and fax back to me. Multiple email recipients could be resolved from
one line of text. Is there a way to code around multiple address book name
choices? Possibly to search for the email type = "SMTP" as a way of
choosing or at least narrowing the possibilities? Am I going about this
wrongly or can is there a better approach?

As a side thought, how do I determine (codewise) if the name has or has not
been resolved?

Regards
Dale
 
D

Dmitry Streblechenko

I don't think there is much you can do unless you explicitly find the
corresponding contact in the Contacts folder and read the e-mail address
(ContactItem.Email1Address).
To see whether a recipient was resolved, call Recipient.Resolve or
Recipients.ResolveAll; both will return a boolean indicating success or
failure.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

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