The AdContac.exe sample is available which can be used to add sender information of incoming message to contacts (198725)



The information in this article applies to:

  • Microsoft Exchange Development Kit (EDK) 5.0
  • Microsoft Exchange Development Kit (EDK) 5.5
  • Microsoft Outlook 2002

This article was previously published under Q198725

SUMMARY

AdContac.exe is a self-extracting archive that contains a custom rule extension sample that is written with Microsoft Visual C++ for use with Microsoft Outlook.

AdContac is a custom action .dll file for use with the Rule Wizard in Outlook. When you are configuring the custom action, you are presented with a list of all of the Outlook Address Book-enabled Contacts folders in the current profile. You can select a Contacts folder from any store. When a message that meets the conditions for your Inbox rule arrives, AdContac obtains the sender information from the message and creates a new entry in the Outlook Address Book (Contacts) by using Extended Messaging Application Programming Interface (MAPI).

Use this sample to start creating custom actions for use with the Rule Wizard in Outlook. This sample also provides a working example of how to use the Exchange extension interfaces from Visual C++.

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:

Installing and Configuring the Sample

  1. Compile and build AdContact.dll by using Microsoft Visual C++.
  2. Copy AdContac.dll to the desired target directory.
  3. Open the AdContac.reg file in Notepad and change the path to reflect the actual location of the AdContac.dll on your computer.
  4. Save the AdContac.reg file, and then exit Notepad.
  5. Double-click the AdContac.reg file to register the AdContac.dll for use by Outlook as a custom action.
  6. Switch to or start Outlook, and then start the Rules Wizard from the Tools menu.
  7. Click New to add a new rule to Outlook.
  8. Click Check Messages when they arrive, and then click Next. Note: You may need to click Start from a blank rule first before this option is available.
  9. Select the option that you want, and then provide the condition to which you want the rule to respond.
  10. Click Next after you have provided the condition that will trap a message.
  11. Click Perform a Custom Action.
  12. Click a custom action in the Description box, and then click AddSenderToContacts in the drop-down list.
  13. Click Change, and then select a Contacts folder from the list. The name of the selected Contacts folder should be filled in the Action Value box.

    Note: If your Contacts folder is not on the list:
    1. Cancel the rule setup and return to the Outlook Explorer shell.
    2. Right-click the Contacts folder, and then click Properties.
    3. In the Properties dialog box, on the Outlook Address Book tab, click Show this folder as an e-mail address book.
  14. Click Next and select any exceptions that you want to apply to this rule.
  15. Click Next, and then type a name for this rule.
  16. Make sure that the Turn on this Rule box is selected.
  17. Verify that all of the settings are correct, and then click Finish.
  18. Test the rule by sending yourself a message that meets the rule's conditions.

    The sender of the message should be added to the selected Contacts folder.
You can use the included Microsoft Visual C++ project and source code as a template for other custom actions.

Modification Type:MinorLast Reviewed:8/30/2004
Keywords:kbcontacts kbConfig kbdownload kbFAQ kbfile kbgraphxlinkcritical kbhowto kbMsg kbOutlookObj kbSample KB198725