Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Closing an open PDF
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
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
Reply


Messages In This Thread
Closing an open PDF - by mv8167 - 08-15-2012, 09:37 PM
RE: Closing an open PDF - by ravi.gajul - 08-19-2012, 12:00 PM
RE: Closing an open PDF - by mv8167 - 08-21-2012, 12:22 AM
RE: Closing an open PDF - by ravi.gajul - 08-21-2012, 01:45 AM
RE: Closing an open PDF - by mv8167 - 08-23-2012, 07:09 PM
RE: Closing an open PDF - by ravi.gajul - 08-23-2012, 10:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  SAP GUI gets hanged while closing the Windows Pop Up kathirvelnagaraj 0 5,527 10-23-2015, 06:47 PM
Last Post: kathirvelnagaraj
  When QTP is open am not able to open my AUT. chetan3987 2 3,099 02-12-2014, 01:18 AM
Last Post: supputuri
  recovery scenario for closing a message box itself ashima 0 2,238 12-26-2013, 11:10 AM
Last Post: ashima
  closing browser at end bistritapcv 3 6,202 04-12-2013, 07:21 AM
Last Post: basanth27
  closing the browser diya 3 3,598 11-27-2012, 10:14 PM
Last Post: diya

Forum Jump:


Users browsing this thread: 2 Guest(s)