Thread View: adobe.scripting
1 messages
1 total messages
Started by matthew_stuehler
Thu, 26 Aug 2004 01:50
how to test if acrobat is already open, file exists
Author: matthew_stuehler
Date: Thu, 26 Aug 2004 01:50
Date: Thu, 26 Aug 2004 01:50
33 lines
1728 bytes
1728 bytes
All,
I'm trying to write a vbscript (or jscript) that is supposed to open Acrobat, open a file, and then merge a second file to the end of the first.
I've gotten the script to work; however, it fails if Acrobat (or Adobe Reader) is ALREADY open. So, is it possible to test whether the application is already open, and, if it is, get a handle to it?
Also, how do you test whether a file exists?
Here's an excerpt of my current script:
--- Begin code ----
Set objApp = CreateObject("Acroexch.app")
Set objAVDoc = CreateObject("AcroExch.AVDoc")
Path = "c:\doc1.pdf"
If (objAVDoc.Open(Path, Path)) Then
Set objPDDoc = objAVDoc.GetPDDoc()
Set objJSO = objPDDoc.GetJSObject
Path = "c:\doc2.pdf"
objJSO.insertPages objJSO.numPages-1, Path, 0, 1
end if
objApp.CloseAllDocs
Set objJSO = Nothing
Set objPDDoc = Nothing
Set objAVDoc = Nothing
Set objApp = Nothing
--- end code ----
Many thanks in advance!
Cheers to all,
Matt Stuehler
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads