
Folder_OnMessageCreated in Exchange 5.5 Public folder
Trying to write a
VBScript Event in an Exchange 5.5 public folder to
automatically reply with an attachment to a mesage posted into the folder.
The code below works, but can I automatically add an attachment (word
doc/Adobe Acrobat etc) to the reply. We also have "Disable Auto replies to
the Internet" disabled on our IMS connector. Can I get around this via code
?
Any help much appreciated
Thanks
Dave
' DESCRIPTION: This event is fired when a new message is added to the folder
Public Sub Folder_OnMessageCreated
Dim SourceMsg
Dim ReplyMsg
Dim Recipient
'Create a new message
Set ReplyMsg = EventDetails.Session.Outbox.Messages.Add
'Set subject and body
ReplyMsg.Subject = "RE: Inquiry"
ReplyMsg.Text = "Please find attached the information you requested"
'Address the message
Set Recipient = ReplyMsg.Recipients.Add
Set SourceMsg = EventDetails.Session.GetMessage(EventDetails.MessageID,
Null)
Recipient.Name = SourceMsg.Sender
Recipient.Type = 1 'This means CdoTo
Recipient.Resolve
'Send the message
ReplyMsg.Send
End Sub