ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   opening a pdf file from excel (https://www.excelbanter.com/excel-programming/382472-opening-pdf-file-excel.html)

Spike

opening a pdf file from excel
 
Should have asked this with my earlier question re logos on buttons as
thought straightforward.

Please will someone give me the code to open a PDF file from within Excel.
I have a button on a spreadsheet that i wish to use to open a PDF file.

many thanks
--
with kind regards

Spike

Tom Ogilvy

opening a pdf file from excel
 
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"""
' Next line would print the file
'Application.SendKeys "^p~", False
End Sub

--
Regards,
Tom Ogilvy

"Spike" wrote:

Should have asked this with my earlier question re logos on buttons as
thought straightforward.

Please will someone give me the code to open a PDF file from within Excel.
I have a button on a spreadsheet that i wish to use to open a PDF file.

many thanks
--
with kind regards

Spike


Spike

opening a pdf file from excel
 
Many thanks works a treat
--
with kind regards

Spike


"Tom Ogilvy" wrote:

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"""
' Next line would print the file
'Application.SendKeys "^p~", False
End Sub

--
Regards,
Tom Ogilvy

"Spike" wrote:

Should have asked this with my earlier question re logos on buttons as
thought straightforward.

Please will someone give me the code to open a PDF file from within Excel.
I have a button on a spreadsheet that i wish to use to open a PDF file.

many thanks
--
with kind regards

Spike



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com