T
tommy Hermann
Hi
I have made a macro in VBA that is able to print pdf's from a folder
and thereafter move the email's to another folder.
My problem is, that the macro was based on adobe 9.0
But in the meantime newer versions of adobe has showed up, and I
cannot update the macro to a newer version.
This is the sentance that i cannot change:
Shell """C:\Programmer\Adobe\Reader 9.0\Reader\acrord32.exe"" /h /p
""" + FileName + """", vbHide
If i change reader 9.0 to 9.4.1 the macro doens work.
Here is the full programming:
Public Sub PrintAttachments()
Dim Inbox As MAPIFolder
Dim Item As MailItem
Dim Atmt As Attachment
Dim FileName As String
Dim topath As String
Dim i As Integer
Set Inbox =
GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Parent.Folders.Item("Batch
Prints")
Set inbox1 =
GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Parent.Folders.Item("Batch
copy")
For Each Item In Inbox.Items
For Each Atmt In Item.Attachments
'all attachments are first saved in the temp folder C:
\Temp. Be sure to create this folder.
FileName = "C:\Temp\" & Atmt.FileName
Atmt.SaveAsFile FileName
'please change the program folder accordingly if the
Acrobat Reader is not installed on drive C:
Shell """C:\Programmer\Adobe\Reader 9.0\Reader
\acrord32.exe"" /h /p """ + FileName + """", vbHide
Next
Item.Move inbox1 'tommy
Item.Delete 'remove this line if you don't want the email be
deleted automatically
Next
Set Inbox = Nothing
End Sub
Best regards Tommy
I have made a macro in VBA that is able to print pdf's from a folder
and thereafter move the email's to another folder.
My problem is, that the macro was based on adobe 9.0
But in the meantime newer versions of adobe has showed up, and I
cannot update the macro to a newer version.
This is the sentance that i cannot change:
Shell """C:\Programmer\Adobe\Reader 9.0\Reader\acrord32.exe"" /h /p
""" + FileName + """", vbHide
If i change reader 9.0 to 9.4.1 the macro doens work.
Here is the full programming:
Public Sub PrintAttachments()
Dim Inbox As MAPIFolder
Dim Item As MailItem
Dim Atmt As Attachment
Dim FileName As String
Dim topath As String
Dim i As Integer
Set Inbox =
GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Parent.Folders.Item("Batch
Prints")
Set inbox1 =
GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Parent.Folders.Item("Batch
copy")
For Each Item In Inbox.Items
For Each Atmt In Item.Attachments
'all attachments are first saved in the temp folder C:
\Temp. Be sure to create this folder.
FileName = "C:\Temp\" & Atmt.FileName
Atmt.SaveAsFile FileName
'please change the program folder accordingly if the
Acrobat Reader is not installed on drive C:
Shell """C:\Programmer\Adobe\Reader 9.0\Reader
\acrord32.exe"" /h /p """ + FileName + """", vbHide
Next
Item.Move inbox1 'tommy
Item.Delete 'remove this line if you don't want the email be
deleted automatically
Next
Set Inbox = Nothing
End Sub
Best regards Tommy