Closing an open PDF - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Closing an open PDF (/Thread-Closing-an-open-PDF) |
Closing an open PDF - mv8167 - 08-15-2012 What ise wrong with: ** Code: Set AcroAVDoc = CreateObject( "AcroExch.AVDoc" ) '** NONE OF THE BELOW CLOSE THE PDF Code: AVDoc.CloseAllDocs() WHAT AM I DOING WRONG? (I think I made a mess of this) RE: Closing an open PDF - ravi.gajul - 08-19-2012 Hi, Please see the corrected code below Code: Set AcroApp = CreateObject( "AcroExch.App" ) Regards, Ravi RE: Closing an open PDF - mv8167 - 08-21-2012 Tax again Ravi but how do i then close my file? What i am trying wont close my open PDF. thx RE: Closing an open PDF - ravi.gajul - 08-21-2012 The lines below should close the file Code: AcroApp.Hide() Code: AcroApp.Hide() documents, releasing OLE references, and finally exiting the application. If any step fails, the function returns 0, and the application will continue running. This method will not work if the application is visible (if the user is in control of the application). In such cases, if the Show() method had previously been called, you may call Hide() and then Exit(). Please let me know your findings.If this doesn't help..please let me know whether or not there is an error message, if so, what it is? Regards, Ravi RE: Closing an open PDF - mv8167 - 08-23-2012 Ravi... Thx this worked perfectly. I had no error message, i just could not get my PDF to close. I think my earlier code was incorrect. Your the best, THX RE: Closing an open PDF - ravi.gajul - 08-23-2012 Glad it worked.Thank you. |