scripts wont run after upgrading to 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have the following script which takes an email detaches all attachments
and saves them as csv. This was working fine yesterday when I was using
Outlook 2002 but today I updgraded to 2003 and now doesn't fire. I've tried
lowering the macro security to low and tried to recreate the rule, also
re-started outlook but the rule still doesn't fire. Does anybody know what's
wrong?

Thanks,.

Panos.

Script below...

Sub MessageRuleSaveAttachment(Item As Outlook.MailItem)
Dim oFSO As FileSystemObject
Dim app As Excel.Application
Dim oWorkbook As Excel.Workbook
Dim File_Save_Name As String
Dim DestDir As String

DestDir = "\\ldnprdapp16\ftp$\impliedVol\"

Set oFSO = New FileSystemObject

Set app = New Excel.Application

app.DisplayAlerts = False

For Each att In Item.Attachments
att.SaveAsFile DestDir & att.FileName

'Item.SaveAs ("c:\test\save\Test.msg")
Item.Delete
Set oWorkbook = app.Workbooks.Open(FileName:=DestDir & att.FileName,
ReadOnly:=True, Editable:=False)

' prepare the file and remove the .xls bit
File_Save_Name = InStr(1, att.FileName, ".xls", 1) - 1
File_Save_Name = Mid(att.FileName, 1, File_Save_Name) & ".csv"

'Save the csv file into the Pending dir
oWorkbook.SaveAs FileName:=DestDir & "Pending\" & File_Save_Name,
FileFormat:=xlCSV, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False, CreateBackup:=False
att.Delete
Next

' clean the application objects etc
Set oFSO = Nothing

app.Quit

Set oWorkbook = Nothing
Set app = Nothing
End Sub
 
Does any simple VBA macro run?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Something weird happened and now it started working. I've played about with
the security options, I've created a certificate from Mirsoft VBA certificate
tool, selected the certificate, lowered security to low, restarted outlook
and one of these steps made it work.

Problem is I am not sure what exactly made it work but I am scared to do it
from scratch in case I can't get it right and it won't work again. Any ideas
as to what's the correct sequence of events and then may try again with a
brand new macro as a test! Thanks.

Panos.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top