PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

Print batch to pdf

 
 
tommy Hermann
Guest
Posts: n/a
 
      20th Apr 2012
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
 
Reply With Quote
 
 
 
 
H. Druss
Guest
Posts: n/a
 
      22nd Apr 2012


"tommy Hermann" <(E-Mail Removed)> wrote in message
news:ae526d50-c2b3-478e-80e0-(E-Mail Removed)...
> 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


The macro should work as is. The executable for 9.41 is acrord32.exe and it
is in the folder
"C:\Programmer\Adobe\Reader 9.0\Reader\"

Although I would change the line to:
Shell """C:\Programmer\Adobe\Reader 9.0\Reader\acrord32.exe"" /h /p
""" & FileName & """", vbHide

I assume all the quote marks are correct.

> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to print batch of PDF files programmatically David Cho Microsoft C# .NET 5 24th Nov 2008 12:53 PM
Print Report to PDF with .pdf Name and Print Driver coded rwboyden via AccessMonster.com Microsoft Access External Data 3 7th Feb 2008 08:12 PM
print PDF file from Excel - NOT print Excel to PDF? Alan Ibbotson Microsoft Excel Programming 1 28th Dec 2006 05:03 AM
Batch print PDF files without Acrobat Serge Windows XP General 1 8th Dec 2004 10:10 PM
Re: How can I Batch print to a PDF converter??? M Skabialka Microsoft Access Reports 0 20th Aug 2003 06:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:47 AM.