I've created a macro to be able to import tables from a PDF, must be like 60 PDFs a day, but now I've discovered that those PDFs are protected so VBA can not access the information inside it. Unless if i print it as a new PDF.
I've gone as far as to be able to open the printing prompt, but because of the volume of information I need it to be more "automatic". I don't want to choose the Path where it will be saved or even it's name.
I have no idea on what should be my next steps This is the code that I'm using to open and print the PDF
Option Explicit
Private Declare PtrSafe Function ShellExecute Lib "shell32" Alias "ShellExecuteA" (ByVal hwnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_HIDE As Long = 0&
Public Sub Print_PDFs()
Dim caminho As String
caminho = "C:\Users\93250121\Desktop\Tadeu\100722081309300_20563822_47774_20220824164855979_8.pdf"
ShellExecute_Print caminho
End Sub
Public Sub ShellExecute_Print(file As String, Optional printerName As String)
If printerName = "" Then
ShellExecute Application.hwnd, "PrintTo", file, vbNullString, 0&, SW_HIDE
Else
ShellExecute Application.hwnd, "PrintTo", file, Chr(34) & printerName & Chr(34), 0&, SW_HIDE
End If
End Sub