Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default using excel vba to print a pdf file

does anyone know how to print an adobe file using an excel macro?
--
Helping Is always a good thing
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default using excel vba to print a pdf file

Here is one approach:

Sub Tester2a()
Shell "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" & _
" c:\toc1\amcr37-4.pdf", 1
' the following prints the document
Application.SendKeys "^p~", False
End Sub


or if you have .pdf associated with acrobat reader:


Private Sub CommandButton1_Click()
Shell "Start.exe ""D:\My Documents\sm569_Jan2001\tute6.pdf"""
Application.SendKeys "^p~", False
End Sub




--

Regards,

Tom Ogilvy



"QuietMan" wrote in message
...
does anyone know how to print an adobe file using an excel macro?
--
Helping Is always a good thing



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default using excel vba to print a pdf file

Thanks Tom
--
Helping Is always a good thing


"Tom Ogilvy" wrote:

Here is one approach:

Sub Tester2a()
Shell "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" & _
" c:\toc1\amcr37-4.pdf", 1
' the following prints the document
Application.SendKeys "^p~", False
End Sub


or if you have .pdf associated with acrobat reader:


Private Sub CommandButton1_Click()
Shell "Start.exe ""D:\My Documents\sm569_Jan2001\tute6.pdf"""
Application.SendKeys "^p~", False
End Sub




--

Regards,

Tom Ogilvy



"QuietMan" wrote in message
...
does anyone know how to print an adobe file using an excel macro?
--
Helping Is always a good thing




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default using excel vba to print a pdf file

Tom,

I'm receiving a file not found error, even though I know the pathe is correct
is it because the file is located on a share network drive?

here is the code i have

Sub Tester2a()
Path_PDF = Range("Access_Path")
Prn_File = Range("Access_File")
Shell "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" & Path_PDF &
"\" & Prn_File & ", 1"
' the following prints the document
Application.SendKeys "^p~", False
End Sub
--
Helping Is always a good thing


"Tom Ogilvy" wrote:

Here is one approach:

Sub Tester2a()
Shell "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" & _
" c:\toc1\amcr37-4.pdf", 1
' the following prints the document
Application.SendKeys "^p~", False
End Sub


or if you have .pdf associated with acrobat reader:


Private Sub CommandButton1_Click()
Shell "Start.exe ""D:\My Documents\sm569_Jan2001\tute6.pdf"""
Application.SendKeys "^p~", False
End Sub




--

Regards,

Tom Ogilvy



"QuietMan" wrote in message
...
does anyone know how to print an adobe file using an excel macro?
--
Helping Is always a good thing




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default using excel vba to print a pdf file

Tom had a space between acrord32.exe and the file name. You'll want one, too.

Shell "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe " & _
Path_PDF & "\" & Prn_File & ", 1"



QuietMan wrote:

Tom,

I'm receiving a file not found error, even though I know the pathe is correct
is it because the file is located on a share network drive?

here is the code i have

Sub Tester2a()
Path_PDF = Range("Access_Path")
Prn_File = Range("Access_File")
Shell "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" & Path_PDF &
"\" & Prn_File & ", 1"
' the following prints the document
Application.SendKeys "^p~", False
End Sub
--
Helping Is always a good thing

"Tom Ogilvy" wrote:

Here is one approach:

Sub Tester2a()
Shell "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" & _
" c:\toc1\amcr37-4.pdf", 1
' the following prints the document
Application.SendKeys "^p~", False
End Sub


or if you have .pdf associated with acrobat reader:


Private Sub CommandButton1_Click()
Shell "Start.exe ""D:\My Documents\sm569_Jan2001\tute6.pdf"""
Application.SendKeys "^p~", False
End Sub




--

Regards,

Tom Ogilvy



"QuietMan" wrote in message
...
does anyone know how to print an adobe file using an excel macro?
--
Helping Is always a good thing





--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default using excel vba to print a pdf file

Dave,
Thanks that was driving me crazy

Now how can I get it to print multiple pdf's, tried looping it but only one
prints
--
Helping Is always a good thing


"Dave Peterson" wrote:

Tom had a space between acrord32.exe and the file name. You'll want one, too.

Shell "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe " & _
Path_PDF & "\" & Prn_File & ", 1"



QuietMan wrote:

Tom,

I'm receiving a file not found error, even though I know the pathe is correct
is it because the file is located on a share network drive?

here is the code i have

Sub Tester2a()
Path_PDF = Range("Access_Path")
Prn_File = Range("Access_File")
Shell "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" & Path_PDF &
"\" & Prn_File & ", 1"
' the following prints the document
Application.SendKeys "^p~", False
End Sub
--
Helping Is always a good thing

"Tom Ogilvy" wrote:

Here is one approach:

Sub Tester2a()
Shell "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" & _
" c:\toc1\amcr37-4.pdf", 1
' the following prints the document
Application.SendKeys "^p~", False
End Sub


or if you have .pdf associated with acrobat reader:


Private Sub CommandButton1_Click()
Shell "Start.exe ""D:\My Documents\sm569_Jan2001\tute6.pdf"""
Application.SendKeys "^p~", False
End Sub




--

Regards,

Tom Ogilvy



"QuietMan" wrote in message
...
does anyone know how to print an adobe file using an excel macro?
--
Helping Is always a good thing




--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default using excel vba to print a pdf file

Maybe...

Sub Tester2a()
dim myCell as range
dim Path_PDF as string
dim Prn_File_Rng as range

Path_PDF = Range("Access_Path")
set Prn_File_Rng = Range("Access_File_Rng")

for each mycell in prn_file_rng.cells
Shell "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe " _
& Path_PDF & "\" & mycell.value & ", 1"
Application.SendKeys "^p~", False
next mycell
End Sub

Maybe you can send ctrl-Q to exit the Reader after it prints, too???

(Untested, uncompiled)

QuietMan wrote:

Dave,
Thanks that was driving me crazy

Now how can I get it to print multiple pdf's, tried looping it but only one
prints
--
Helping Is always a good thing

"Dave Peterson" wrote:

Tom had a space between acrord32.exe and the file name. You'll want one, too.

Shell "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe " & _
Path_PDF & "\" & Prn_File & ", 1"



QuietMan wrote:

Tom,

I'm receiving a file not found error, even though I know the pathe is correct
is it because the file is located on a share network drive?

here is the code i have

Sub Tester2a()
Path_PDF = Range("Access_Path")
Prn_File = Range("Access_File")
Shell "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" & Path_PDF &
"\" & Prn_File & ", 1"
' the following prints the document
Application.SendKeys "^p~", False
End Sub
--
Helping Is always a good thing

"Tom Ogilvy" wrote:

Here is one approach:

Sub Tester2a()
Shell "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" & _
" c:\toc1\amcr37-4.pdf", 1
' the following prints the document
Application.SendKeys "^p~", False
End Sub


or if you have .pdf associated with acrobat reader:


Private Sub CommandButton1_Click()
Shell "Start.exe ""D:\My Documents\sm569_Jan2001\tute6.pdf"""
Application.SendKeys "^p~", False
End Sub




--

Regards,

Tom Ogilvy



"QuietMan" wrote in message
...
does anyone know how to print an adobe file using an excel macro?
--
Helping Is always a good thing




--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
print all worksheets of Excel file to one pdf file Centerfield Excel Discussion (Misc queries) 3 April 30th 09 04:51 AM
my excel is converting all my print jobs to print to file why? Ginger Excel Discussion (Misc queries) 2 April 10th 07 12:28 PM
How do I print from a file created from sending a print to a file Ted Johnston Excel Discussion (Misc queries) 1 February 23rd 06 03:10 AM
How to make a routine that will automatically print a word file after it has been changed via an ole link to an excel file? Starriol Excel Programming 0 November 3rd 05 11:59 AM
FILE Save As / FILE Print greyed out in Excel Jeff Wright Excel Programming 2 September 3rd 03 09:29 AM


All times are GMT +1. The time now is 02:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"