PRB: Changing Properties of AddressEntry object of a RecipientLast reviewed: November 21, 1997Article ID: Q171671 |
The information in this article applies to:
SYMPTOMSWhen attempting to change properties or fields of the AddressEntry object of a Recipient of a message, the property/field changes are not saved. For example, using the following code, the change to the PR_SEND_RICH_INFO is not saved, as seen in the Details page that is displayed. (See the MORE INFORMATION section below for how the variables are defined.)
RESOLUTIONFollow these steps to make changes to the AddressEntry object of a recipient of a message. This code may be used to correct the complete code example provided in the MORE INFORMATION section below.
MORE INFORMATION
Steps to Reproduce BehaviorThe following code placed in a Visual Basic module will reproduce the problem described in the Symptoms section above. Note that the property change used here for illustration purposes assumes that the default setting of the PR_SEND_RICH_INFO property is True. If the default setting on your system is False, you will want to modify the code below to see the behavior.
' Note that you should have "Microsoft Active Messaging 1.1 Object ' Library" marked as a reference for your project in order for this ' code to function. Dim objSession As Session Dim objMessage As Mapi.Message Dim objRecip As Mapi.Recipient Dim objAddress As Mapi.AddressEntry ' Create and logon to a MAPI Session Set objSession = CreateObject("Mapi.Session") objSession.Logon ShowDialog:=True ' Create a new message Set objMessage = objSession.Outbox.Messages.Add ' Create a new recipient on our message Set objRecip = objMessage.Recipients.Add ' Set the properties of our recipient and resolve to a single address objRecip.Name = "myemail@mycompany.com" objRecip.Type = ActMsgTo objRecip.Resolve ' *** To make this code function as needed, replace this section ' *** of code with the corrected code provided in the Resolution ' *** section above. ' Attempt to set the PR_SEND_RICH_INFO property. ' This is the line of code that may need to change, depending on the ' default setting on your system. objRecip.AddressEntry.Fields(ActMsgPR_SEND_RICH_INFO) = False ' Update the AddressEntry object objRecip.AddressEntry.Update ' View the details of the Recipient to confirm changes objRecip.AddressEntry.Details ' Delete the message and Logoff the Session objMessage.Delete objSession.Logoff REFERENCESFor additional information about Collaboration Data Objects versus Active Messaging, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q176916 TITLE : INFO: Active Messaging and Collaboration Data Objects (CDO) Keywords : kbcode ActMsg Version : WINDOWS:1.1 Platform : WINDOWS Issue type : kbprb |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |