Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using Excel VBA, how can I determine the pdf files that are opened in the user's session?

Community Beginner ,
May 03, 2019 May 03, 2019

If I were writing this to find opened word documents the code would be

Set wdApp = GetObject(, "Word.Application")

This gives me the number of open word documents.

How can I do the same for pdf files?

1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , May 06, 2019 May 06, 2019

I will go to Acrobat SDK in the future.

The answer is was looking for is below, it works well. Thanks

        Dim pdApp As Acrobat.AcroApp

        Dim pdDoc As Acrobat.AcroPDDoc

        Dim numPDF As Integer

Set pdApp = CreateObject("AcroExch.App")

Set pdDoc = CreateObject("AcroExch.PDDoc")

numPDF = pdApp.GetNumAVDocs

MsgBox (numPDF)

Translate
Community Expert ,
May 05, 2019 May 05, 2019

Via the JavaScript object, run this code:

app.activeDocs.length

PS. In the future you'll be better off to ask questions about Acrobat in one of the Acrobat forums, like this one: Acrobat SDK

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 06, 2019 May 06, 2019
LATEST

I will go to Acrobat SDK in the future.

The answer is was looking for is below, it works well. Thanks

        Dim pdApp As Acrobat.AcroApp

        Dim pdDoc As Acrobat.AcroPDDoc

        Dim numPDF As Integer

Set pdApp = CreateObject("AcroExch.App")

Set pdDoc = CreateObject("AcroExch.PDDoc")

numPDF = pdApp.GetNumAVDocs

MsgBox (numPDF)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines