Quantcast
Channel: Adobe Community : Unanswered Discussions - Acrobat
Viewing all articles
Browse latest Browse all 73766

using Excel vba to control Adobe reader 9 to print pdf

$
0
0

I want to write an Excel VBA to instruct Adobe reader 9 to print all the pdf files in a folder. I found the following script on the interest.

*******************************************************************

Option Explicit

 

 

Public Sub PrintPDFFiles()

    Const ADOBEPATH As String = "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe"

   

    Const FILE_PATH As String = "H:\print"

    Const FILE_EXT As String = "PDF"

  

    Dim fso, fld, file As Object

   

    Set fso = CreateObject("Scripting.FileSystemObject")

    Set fld = fso.GetFolder(FILE_PATH)

   

    For Each file In fld.Files

        If UCase(Right(file.Name, 3)) = FILE_EXT Then

          

            Shell ("""C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe""/print  " & file.Path)

          

           'Shell ("""" & ADOBEPATH & """""/print""" & file.Path)

        End If

    Next

End Sub

***********************************************

 

People suggests to use either

 

1) Shell ("""" & ADOBEPATH & """""/print""" & file.Path)

 

or

 

2) Shell ("""C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe"" /print " & FileID)

 

I have tried all the versions. When I run the program, Excel VBA only open the file by using Adobe reader. It doesn't print at all. I wonder why?

 

Also, I would like to ask how to use the variable in using Shell function?

Is it using this ----> Shell ("""" & ADOBEPATH & """""/print""" & file.Path)


Viewing all articles
Browse latest Browse all 73766

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>