• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
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

Copy link to clipboard

Copied

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?

Views

1.6K

Translate

Translate

Report

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)

Votes

Translate

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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)

Votes

Translate

Translate

Report

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