In composing a message, you name a person in the To or CC list. Let's say it is our old friend "Joe Blow." But Outlook can't send a message to Joe Blow. Recipient.Resolve attempts to find the "familiar" name in your address book and will try to convert it to some string such as "Joe.Blow3@obscurity.com" - a formal e-mail address to which Outlook CAN send a message.
If I don't use this resolve method, outlook sends the mail anyway and my friend receives it. (As long as the same name exists in my address book). I've tried it several time. Is there any reason to resolve the recipient?
I think outlook check the names in .To and resolves them before sending.
This is my test:
Code:
Dim oApp As Object
Dim oEmail As Object
Set oApp = CreateObject("Outlook.Application")
Set oEmail = oApp.CreateItem(0)
With oEmail
.To = "John Snow"
.subject = "Test"
.HTMLBody = "<p>test</p></body>"
.Display
End With
Doc, I hope you don't mind adding one more question:
Is it possible to do the opposite?
I mean I give an address to .To and outlook resolve it to a name?
The reason:
I have a database which a lot of users are using it. They have the same mail address in their address book, but it may be saved under different names. Some use English alphabet for their address book. Some use Japanese. The make it worse, in Japanese we can write the same name using three different alphabets.
Now if I want to send a report as a mail and use the name of receiver in .To and resolve it, outlook may not be able to find the name. because some may have it in Japanese, some in English.
Hi Tera. I know you have seen this thread before, but have you looked at the code posted by sxschech about resolving names? Just curious, it might help with your situation. Good luck!
Hi Tera. I know you have seen this thread before, but have you looked at the code posted by sxschech about resolving names? Just curious, it might help with your situation. Good luck!
Sorry, I had seen the post but didn't bother to test the code. My bad.
I think it works for me now.
I'll come back again if I find any problem concerning it.
Sorry, I had seen the post but didn't bother to test the code. My bad.
I think it works for me now.
I'll come back again if I find any problem concerning it.