A
ah
Can I have more than 1 script running in 1 outlook mailbox?
I've created a script as follows previously:
Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem
Dim rpl As Outlook.MailItem
strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set msg = olNS.GetItemFromID(strID)
' do stuff with msg, e.g.
Set rpl = msg.Reply
rpl.Body = "testing" & vbCrLf & rpl.Body
rpl.Subject = "Authorization fail"
rpl.Send
Set msg = Nothing
Set olNS = Nothing
End Sub
Sub test()
End Sub
The above script should be run when the e-mail was sent by those
unauthorized personnel.
Now, I wish to run another script to generate an auto reply e-mail to the
authorized personnel with another message, for example: Thanks for your
e-mail etc. But, I found that I can only put in 1 script in the macro. Kindly
advice me on how to resolve this issue.
Thanks in advance
I've created a script as follows previously:
Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem
Dim rpl As Outlook.MailItem
strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set msg = olNS.GetItemFromID(strID)
' do stuff with msg, e.g.
Set rpl = msg.Reply
rpl.Body = "testing" & vbCrLf & rpl.Body
rpl.Subject = "Authorization fail"
rpl.Send
Set msg = Nothing
Set olNS = Nothing
End Sub
Sub test()
End Sub
The above script should be run when the e-mail was sent by those
unauthorized personnel.
Now, I wish to run another script to generate an auto reply e-mail to the
authorized personnel with another message, for example: Thanks for your
e-mail etc. But, I found that I can only put in 1 script in the macro. Kindly
advice me on how to resolve this issue.
Thanks in advance