0

Using,

CAcroPDDoc PdDocObj = AvDocObj.GetPDDoc() as CAcroPDDoc;

I am able to retrieve PdDocObj, but unable to find any property/method that provides me pdf file-location.

Aniket Bhansali
  • 630
  • 12
  • 33

1 Answers1

0

From PDDoc you can init the JSObject (set jso = PDDoc.GetJSObject) and then use something like jso.path, which will give you the device-indepentend path of the document.

OK. Following a complete working VBS example. Good Luck, Reinhard

Info = "View the path of the active doc" &vbCR &"Acrobat must be opened with an active document"
OK = MsgBox(Info, vbQuestion+vbYesNo)
if OK = vbNo then WScript.quit

Set AcroApp = CreateObject("AcroExch.App")
Set AVDoc = AcroApp.GetActiveDoc
Set PDDoc = AVDoc.GetPDDoc
set jso = PDDoc.GetJSObject
ffn = jso.path
msgbox(ffn) 
ReFran
  • 897
  • 8
  • 14
  • I tried this, var jsObject = PDDocObj.GetJSObject(); But getting nothing in jsObject, Data field of that object has enum which is empty and niether there is class JSObject in c#, Any Clue? – Aniket Bhansali Feb 09 '18 at 06:01
  • I don't know C# and how to work with that with ActiveX elements. However I put an complete working VBS example in my answer, so you can test that – ReFran Feb 09 '18 at 11:42