Outlook autosave attachment rule

Status
Not open for further replies.

Putt4Dough

Baseband Member
Messages
29
Location
Ottawa Canada
Hello,

I have Outlook 2003 SP3 that runs a script in a rule to automatically save all attachments to a Windows folder (see script bellow). All this works fine on one PC but it does not run on other PC's with the same software. Is there a way to know why the script does not work on specific computers?


Public Sub saveAttachtoDisk(itm As Outlook.MailItem)

Dim objAtt As Outlook.Attachment

Dim saveFolder As String
saveFolder = "c:\temp\"

For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
Set objAtt = Nothing
Next
End Sub


TY
Mike

Just found the solution. It was a miss on my side. Here is the procedure to make this script work.

Open Outlook the Alt-F11 for VBA.
Select the “ThisOutlookSession” in the left pane.
Paste the code highlighted in red in my first poste.
Click Save and the select the Debug menu and Compile the project.
Close MS VB.
Make sure your macro security is set no higher then medium. When prompt, enable macros.

Create a rule in Outlook and select the “ThisOutlookSession” to run a script.

So the issue was that I did not compile the project and that the macros security was set to high.

Voila.
Mike
 
Status
Not open for further replies.
Back
Top Bottom