Article ID: 198629
Article Last Modified on 11/23/2006
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
180826 OL98: Resources for Custom Forms and Programming
182349 OL98: Questions About Custom Forms and Outlook Solutions
Additional query words: kbMsg kbOutlookObj kbOutlook97 kbOutlook98 OutSol98 vbscript 98
Keywords: kbbug kbmsg kbnofix kboutlookobj kbprogramming KB198629