When Utilizing AVDoc.Open(), it returns a Boolean depending on whether a pdf document was able to be opened or not.
When the PDF document is not opened it returns False but this also pops up from Adobe:
I was wondering if there was a way to error-code this popup away via, because the program essentially freezes until I first go to my Adobe window and then exit out of the above adobe error prompt. Any suggestions? Below is what my code for this looks like currently:
This utilizes the Adobe Acrobat 10.0 Type Library in Access 2016:
Code:Sub Dim Condition As Boolean Dim PDFDirectory As String Condition = False PDFDirectory = "C:\Users\Me\ADirectory\ABlankPDFFile.pdf" Set AcrobatApplication = CreateObject("AcroExch.App") Set AVDoc = CreateObject("AcroExch.AVDoc") While (Not Condition) If AVDoc.Open(MasterPDF, "") Then 'Do whatever I need to do Condition = True Else If MsgBox("Master PDF not Found, please make sure that the PDF -NameOfPdf- is in the right directory: ___w/e the directory is____" vbOkCancel) = vbCancel Then Exit Sub Else Wend End Sub