Here is my code so far:
This code works perfectly for what I am trying to do... except for one thing:
I want to open and print PDFs that are already embedded into my worksheet. I can use the code to open the embedded PDF files:
How on earth can I just open these files and print them. I've spent so long trying to figure this out. If you can't tell... I'm a bit of a newbie.
End result:
I want to be able to click a button, have it open the embedded pdf file in Adobe Reader, Print it, Close Adobe Reader.
I will name my first born son to the man that can solve this problem for me!
Public Sub PrintPDFFiles()
Const ADOBEPATH As String = "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe"
Const FILE_PATH As String = "C:\Users\kmackie\Desktop\Sample\Test"
Const FILE_EXT As String = "PDF"
Dim fso, fld, file
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 """" & ADOBEPATH & """/n /t """ & file.Path & """"
End If
Next
End Sub
This code works perfectly for what I am trying to do... except for one thing:
I want to open and print PDFs that are already embedded into my worksheet. I can use the code to open the embedded PDF files:
ActiveSheet.Shapes("Object 1").OLEFormat.Activate
How on earth can I just open these files and print them. I've spent so long trying to figure this out. If you can't tell... I'm a bit of a newbie.
End result:
I want to be able to click a button, have it open the embedded pdf file in Adobe Reader, Print it, Close Adobe Reader.
I will name my first born son to the man that can solve this problem for me!