Microsoft KB Archive/221815

From BetaArchive Wiki
Knowledge Base


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

Article ID: 221815

Article Last Modified on 11/23/2006



APPLIES TO

  • Microsoft Outlook 2000 Standard Edition



This article was previously published under Q221815


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 a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

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:

146636 OL2000: Questions About Custom Forms and Outlook Solutions



Additional query words: OutSol OutSol2000 vbscript

Keywords: kbbug kbnofix kbprogramming KB221815