Platform SDK: Exchange 2000 Server

Forwarding Messages

[This is preliminary documentation and subject to change.]

You can forward an existing message using the IMessage.Forward method. The Forward method retains all the attachments from the original message, but does not set any recipients on the new message. You must set the To property in the new message before you send the message.

[Visual Basic]
' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Exchange 2000 Server Library
' ..
Dim iMsgs as CDO.IMessages
Dim iDropDir as New CDO.DropDirectory
Dim iMsg as CDO.Message

Set iMsgs = iDropDir.GetMessages("c:\Inetpub\mailroot\Drop");
Set iMsg = iMsgs(1)

' want to reply all

Dim iMsg2 as CDO.Message
Set iMsg2 = iMsg.Forward
' ..configure message object
'   add any other recipients
iMsg2.TextBody = "You missed this:  " & vbCrLf & iMsg2.TextBody
iMsg2.Send
[C++,IDL]
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace
#import "c:\exchsrvr\cdoex.dll" no_namespace
// ...
IDropDirectoryPtr iDropDir(__uuidof(DropDirectory));
IMessagesPtr iMsgs;
iMessagePtr  iMsg;

iMsgs = iDropDir->GetMessages("c:\\Inetpub\\mailroot\\Drop");
iMsg  = iMsgs->Item[1];

// want to reply all

IMessagePtr iMsg2;
iMsg2 = iMsg->Forward();
//     add any other recipients
iMsg2->TextBody = "You missed this: " + "\r\n" + iMsg2->TextBody;
iMsg2->Send();
[VBScript]
Dim iDropDir
Dim iMsgs
Dim iMsg

Set iDropDir = CreateObject("CDO.DropDirectory")
Set iMsgs = iDropDir.GetMessages("c:\\Inetpub\\mailroot\\Drop")
Set iMsg = iMsgs(1)

' want to reply all

Dim iMsg2
Set iMsg2 = iMsg.Forward
' ... configure message object
'     add any other recipients
iMsg2.TextBody = "You missed this: " & vbCrLf & iMsg2.TextBody
iMsg2.Send