OL97: Cannot Programmatically Change Contact's E-mail AddressLast reviewed: March 2, 1998Article ID: Q173588 |
The information in this article applies to:
SYMPTOMSUsing Microsoft Visual Basic Scripting Edition (VBScript) or Microsoft Visual Basic for Applications, you cannot change the e-mail address of a Microsoft Outlook 97 contact.
WORKAROUNDThere is no known workaround available.
STATUSMicrosoft has confirmed this to be a problem in Microsoft Outlook. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/refguide/default.aspYou can write VBScript or Visual Basic for Applications code to initially set a contact's e-mail address. In other words, if the e-mail address field (typically Email1Address) does not have a value, then the e-mail address can be programmatically changed. If the field already contains an e-mail address, however, the value of the e-mail field will not change and you will not receive an error message. The following Visual Basic for Applications automation code illustrates the problem:
Sub ChangeEmailAddress() ' The Outlook object library must be referenced. Dim ol As New Outlook.Application Dim myContact As ContactItem ' Create a new Contact item. Set myContact = ol.CreateItem(olContactItem) myContact.FullName = "Joe Smith" ' This will properly set the email address. myContact.Email1Address = "joe@abc.com" myContact.Save ' This will not change the email address. myContact.Email1Address = "mike@xyz.com" myContact.Save ' The email address appears to be changed here... MsgBox myContact.Email1Address ' ...but it is not actually changed. myContact.Display End SubNote that programmatically, the Email1Address will properly return the second e-mail address (mike@xyz.com) until the first e-mail address is resolved.
REFERENCESFor more information on programmatically resolving e-mail addresses, please see the following article in the Microsoft Knowledge Base:
Article-ID: Q169750 Title : OL97: How to Programmatically Resolve a Contact's E-mail AddressFor more information about creating solutions with Microsoft Outlook 97, please see the following articles in the Microsoft Knowledge Base:
Article-ID: Q166368 Title : OL97: How to Get Help Programming with Outlook Article-ID: Q170783 Title : OL97: Q&A: Questions about Customizing or Programming Outlook |
Additional query words: OutSol OutSol97
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |