08-19-2012, 12:00 PM
Hi,
Please see the corrected code below
Regards,
Ravi
Please see the corrected code below
Code:
Set AcroApp = CreateObject( "AcroExch.App" )
Set AcroAVDoc = CreateObject( "AcroExch.AVDoc" )
gPDFPath="C:\test.pdf" 'please change the path before execution
' Open the PDF
AcroApp.Show()
AcroApp.Maximize(vbMaximize)
If AcroAVDoc.Open(gPDFPath,"") Then
If AcroAVDoc.IsValid = False Then ExitTest()
AcroAVDoc.BringToFront()
Call AcroAVDoc.Maximize( True )
Set AcroPDDoc = AcroAVDoc.GetPDDoc()
PDFName = AcroPDDoc.GetFileName()
PDFPageCount = AcroPDDoc.GetNumPages()
'msgbox PDFName
'msgbox PDFPageCount
AcroApp.CloseAllDocs()
AcroApp.Exit()
End If
Set AcroApp = Nothing
Set AcroAvDoc = Nothing
Regards,
Ravi