OL2000: ReplyRecipients Property Is Read/Write, Not Read-only

ID: Q221815


The information in this article applies to:
  • Microsoft Outlook 2000


SUMMARY

The Outlook Visual Basic Reference (Vbaoutl9.chm) incorrectly states the ReplyRecipients property of a MailItem object is read-only. The property is actually read/write.


MORE INFORMATION

Microsoft 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 professionals 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/overview/overview.asp
The following code demonstrates how to set the ReplyRecipients property of a MailItem object. Before using the following Visual Basic automation code:
  • Create a reference to the "Microsoft Outlook 9.0 Object Library."


  • Make necessary changes to the code as indicated in the comments below.



Sub AddReplyRecipients()
    Dim oApp As Outlook.Application
    Dim oNS As Outlook.NameSpace
    Dim oUser1 As Outlook.Recipient
    Dim oUser2 As Outlook.Recipient
    Dim oMyItem As Outlook.MailItem

    Set oApp = New Outlook.Application
    Set oNS = oApp.GetNamespace("MAPI")

    Set oMyItem = oApp.CreateItem(olMailItem)
    oMyItem.Subject = "test"
    oMyItem.Body = "Hello, body"

    ' replace "User1" with a valid e-mail alias
    Set oUser1 = oNS.CreateRecipient("User1")
    oUser1.Resolve
    oMyItem.ReplyRecipients.Add oUser1

    ' replace "User2" with a valid e-mail alias
    Set oUser2 = oNS.CreateRecipient("User2")
    oUser2.Resolve
    oMyItem.To = oUser2
    oMyItem.Send
    Set oMyItem = Nothing
    Set oUser1 = Nothing
    Set oUser2 = Nothing
    Set oNS = Nothing
    Set oApp = Nothing
End Sub 


REFERENCES

For additional information about available resources and answers to commonly asked questions about Microsoft Outlook 2000 solutions, please see the following article in the Microsoft Knowledge Base:

Q146636 OL2000: Questions About Custom Forms and Outlook Solutions

Additional query words: OutSol OutSol2000 vbscript

Keywords : kbdta
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: November 13, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.