A
Ashmans
I've created a VBA script which is executed by a rule in Outlook. If the
e-mail has an attachment, then script copies it to a Windows folder then
deletes the e-mail.
The script work fine on Windows 2000 workstation running Outlook 2003.
However, when I set up the same rule and script on a workstation running
Outlook 2002, the rule works (it deletes the e-mail), but does not execute
the script. I know this for certain, as I inserted breakpoints within the
code.
The script is has been placed in the 'ThisOutlookSession' module and the
name of the script does show up in the drop down box in the Rules Wizard.
I've set the Macro Security to low, compiled the code and made sure I
restarted Outlook when either changing the code or the rule.
Here's the code:
Sub HLC(olMsg As Outlook.MailItem)
Dim olAtt As Outlook.Attachments
Set olAtt = olMsg.Attachments
ImpFile = olAtt.item(1).FileName
olAtt.item(1).SaveAsFile "C:\WINNT\Temp\" + ImpFile
Set olAtt = Nothing
Set olMsg = Nothing
End Sub
Any ideas would be appreciated.
Thanks
Steve
e-mail has an attachment, then script copies it to a Windows folder then
deletes the e-mail.
The script work fine on Windows 2000 workstation running Outlook 2003.
However, when I set up the same rule and script on a workstation running
Outlook 2002, the rule works (it deletes the e-mail), but does not execute
the script. I know this for certain, as I inserted breakpoints within the
code.
The script is has been placed in the 'ThisOutlookSession' module and the
name of the script does show up in the drop down box in the Rules Wizard.
I've set the Macro Security to low, compiled the code and made sure I
restarted Outlook when either changing the code or the rule.
Here's the code:
Sub HLC(olMsg As Outlook.MailItem)
Dim olAtt As Outlook.Attachments
Set olAtt = olMsg.Attachments
ImpFile = olAtt.item(1).FileName
olAtt.item(1).SaveAsFile "C:\WINNT\Temp\" + ImpFile
Set olAtt = Nothing
Set olMsg = Nothing
End Sub
Any ideas would be appreciated.
Thanks
Steve