Outlook Email from Access

Tim313
Tim313 used Ask the Experts™
on
The following article refers to "resolve e-mail addresses against the Outlook Address Book" and shows code using -   .Resolve

http://support.microsoft.com/kb/318881

Can anyone explain what this method does?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
The article describes using the Outlook type library to create MailItems from data in an Access address book table.  Resolve in this context means getting the ContactItem display name (Save As property) for the specified Recipent which will work if it's in an Outlook address book (e.g. Outlook Contacts).
Commented:
It is simply determining if that email address is in your Outlook Address Book.

Resolve Method
Office 2003Attempts to resolve a Recipient object against the Address Book. Returns True if the object was resolved, False if it was not.

expression.Resolve

expression    Required. An expression that returns a Recipient object.

Remarks
When you run a program that uses the Microsoft Outlook object model to call the Resolve method, you receive a warning message. This warning message tells you that a program is trying to access the Address Book on your behalf and asks if you want to allow this.

Example
This Visual Basic for Applications (VBA) example uses CreateItem to create a simple task and delegate it as a task request to another user. Before running this example, replace 'Dan Wilson' with a valid recipient name.

Sub AssignTask()
      Dim myOlApp As New Outlook.Application
      Dim myItem As Outlook.TaskItem
      Dim myDelegate As Outlook.Recipient
      Set MyItem = myOlApp.CreateItem(olTaskItem)
      MyItem.Assign
      Set myDelegate = MyItem.Recipients.Add("Dan Wilson")
      myDelegate.Resolve
      If myDelegate.Resolved Then
            myItem.Subject = "Prepare Agenda For Meeting"
            myItem.DueDate = Now + 30
            myItem.Display
            myItem.Send
      End If
End Sub

Author

Commented:
Split points; OxonDev for first response, bigtwig for added detail.
Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial