Using VBA - Check to see if Acrobat Pro is open on users machine

Hello all. I have an Access application that generates a bunch of single page PDF reports in a folder on the users machine, then when it is finished, it combines all of the files into a single pdf file on the users desktop. If the user has left Acrobat Pro open before he starts running the reports, when it begins to try to combine the files, he will get an error message.
I would like to check to see if Adobe Acrobat Pro is open early on in the routine so that the user doesn't have to spend so much time regenerating the reports again. I have not been able to find any VBA code that will do this. Can anyone help?
Thanks,
David

Hello Test Screen Name. I do trap for the error and generate a friendly error message to ask the user to close Adobe Acrobat. The problem is, depending on the criteria they select for the report, it could take 5 to 10 minutes before they ever see that error message because of the hundreds of individual pdf reports it has to generate. It is not until my code is ready to combine those pdf files that they see the message. So, it is not really a runtime error so to speak.
But, I found the answer to my question and wanted to share it with everyone. The answers are located here:
API: Find out if an application is currently running
API: Get Class name of a running app
What I did is paste all code from those 2 pages into a new module in Access. Then I made sure that Adobe Acrobat is loaded on my machine. I ran the sub fEnumWindows() and it printed the Class Names of all of my open programs. I got the class name for Adobe Acrobat, which is AcrobatSDIWindow. Then I modified the select case statement in the following function as so, to include the string acrobat and its Class Name:
[code]
Function fIsAppRunning(ByVal strAppName As String, _
        Optional fActivate As Boolean) As Boolean
    Dim lngH As Long, strClassName As String
    Dim lngX As Long, lngTmp As Long
    Const WM_USER = 1024
    On Local Error GoTo fIsAppRunning_Err
    fIsAppRunning = False
    Select Case LCase$(strAppName)
        Case "excel":      strClassName = "XLMain"
        Case "word":        strClassName = "OpusApp"
        Case "access":      strClassName = "OMain"
        Case "powerpoint95": strClassName = "PP7FrameClass"
        Case "powerpoint97": strClassName = "PP97FrameClass"
        Case "notepad":    strClassName = "NOTEPAD"
        Case "acrobat":  strClassName = "AcrobatSDIWindow"
        Case "wordpad":    strClassName = "WordPadClass"
        Case Else:          strClassName = vbNullString
    End Select
    If strClassName = "" Then
        lngH = apiFindWindow(vbNullString, strAppName)
    Else
        lngH = apiFindWindow(strClassName, vbNullString)
    End If
    If lngH <> 0 Then
        apiSendMessage lngH, WM_USER + 18, 0, 0
        lngX = apiIsIconic(lngH)
        If lngX <> 0 Then
            lngTmp = apiShowWindow(lngH, SW_SHOWNORMAL)
        End If
        If fActivate Then
            lngTmp = apiSetForegroundWindow(lngH)
        End If
        fIsAppRunning = True
    End If
fIsAppRunning_Exit:
    Exit Function
fIsAppRunning_Err:
    fIsAppRunning = False
    Resume fIsAppRunning_Exit
End Function
[/code]
Now I can just send "acrobat" to this function to see if the app is open.
Sincerely,
David

Similar Messages

  • How do you increase the font size to bigger than 24, using the typewriter tool in Adobe Acrobat Pro 9 for Mac?

    How do you increase the font size to bigger than 24, using the typewriter tool in Adobe Acrobat Pro 9 for Mac?   Often I just want to label an item on a map that is in PDF and want to use a simple label rather than a Text Box for labeling, but have yet to find a way to increase the font size beyond 24.   Can someone help me with this? - JML

    Read this:
    https://forums.adobe.com/thread/1468782?sr=stream&ru=2382437

  • I have just updated my computer to windows 8.1 pro and i dont see adobe acrobat pro x1

    i have just updated my computer to windows 8.1 pro and i dont see adobe acrobat pro x1

    Download CS3 products
    Mylenium

  • I want to move / install acrobat pro x1 on a new machine

    I have installed  Acrobat pro X1 on a nw machine entered my serial number but it says the key is not valid for the software i have installed.
    Do i need to deactivate it on my old maxhine first?
    thanks #
    Paul

    No Paul the activation status will not affect your serial number being accepted.  Please see Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html for information on how you can verify the serial number you are entering is the one you have registered with Adobe.

  • Do i need acrobat pro to open a pdf i created in quark and reduce the file size?

    do i need acrobat pro to open a pdf i created in quark and reduce the file size?

    i'll try that! thank you.
    Daniel Flavin <mailto:[email protected]>
    June 24, 2014 at 3:23 PM
    >
          do i need acrobat pro to open a pdf i created in quark and
          reduce the file size?
    created by Daniel Flavin
    <https://forums.adobe.com/people/Daniel+Flavin> in /Creating, Editing
    & Exporting PDFs/ - View the full discussion
    <https://forums.adobe.com/message/6493113#6493113>

  • I downloaded acrobat pro, wont open... error 16

    i downloaded acrobat pro, wont open... error 16 - aid to go to your website

    Hey,
    Please refer this KB doc link and try out the solutions for your OS to resolve error 16:
    Configuration error 16 | CC, CS
    Let me know if this works for you.
    Regards,
    Anubha

  • I cannot get my Acrobat Pro to open. I already uninstalled it and re installed it. But still does not open. The program pops to ask for permission to open the program, but it never actually opens.  I  trouble shoot it and it says incompatible application.

    I cannot get my Acrobat Pro to open. I already uninstalled it and re installed it. But still does not open. The program pops to ask for permission to open the program, but it never actually opens.  I  trouble shoot it and it says incompatible application.

    It sounds like an issue of trying to run XI on VISTA. That combination does not work. Info on both the Acrobat full version (including sub-version) and OS would help. It might also be an issue of running 11.0.0 on a system that needs the updates to work.

  • How can I make Acrobat Pro XI open by default to thumbnails view (Pages Panel & Pages)?

    How can I make Acrobat Pro XI open by default to thumbnails view (Pages Panel & Pages) without changing the properties on every single pdf?

    Not possible. This is a file-specific setting, not an application-wide
    setting.

  • Can I use a buisness version of Adobe Acrobat Pro on a computer that has already an active adobe ID with personal (non buisness versions) programms?

    I have an Abode ID with Photoshop for private use.
    For work I need an updated version of Adobe acrobat pro.
    But how can I get it to work on the same computer?
    Can I add a buisness version to the Adobe (private) ID?
    Or can I use 2 adobe ID's at the same time?

    I don't think there are such things as business and non-business versions of software as far as Adobe is concerned.  How you manage the installations of the software you purchase from them is your call.  If there is some protocol for doing this that is defined by your workplace then you should inquire with whomever manages that protocol.

  • I have  a new laptop...i want to keep using my licened Adobe acrobat pro 9 on teh new machine

    how can I add a new computer to my acrobat pro license

    Hey,
    Firstly, you need to make sure that Acrobat pro 9 is compatible with the OS on your new laptop.
    In order to use the same license, you might need to deactivate Acrobat from old machine and then activate it on the new one with the same serial number.
    Regards,
    Anubha

  • Created an image using Apple 10.6.5 with Acrobat Pro 9.4.1 and CS 5

    Greetings All.  Have a Happy, Healty New Year.
    As I open Acrobat Pro I am instructed to open Photoshop (or other App) first, which I did.
    Again I opened Acrobat Pro and rec'v message stating Acrobat Pro was installed as part of a suite and in order to enable Acrobat Pro
    I must open another CS 5 app. After closing the message Acrobat closes.
    Acrobat Pro was set up earlier with the CS 4 suite and upgraded as we go.
    Our CS 5 purchase did not include Acrobat Pro.
    Is there a workaround for this or do I need to uninstall 9 and install 10.
    Would prefer keeping 9.4.1 for now.
    Thanx
    ...mhu

    So Adobe-ites,
    here is the answer - when Acrobat 9.4 was installed it was installed with CS4. When readying to install CS5, 4 was uninstalled completely.
    I had to re-install any CS4 app., 9.4 recognizes it and problem was solved. 9.4.1 works just fine.
    thanx
    ...mhu

  • Acrobat Pro 9 opens multiple files (50) on every start

    Start the program or click on a pdf file and - pro 9 opens and loads every ******* pdf file I've had open in the past however long.  Seems to be a limit of 50 files - tries to load a few more and then stops.  What's changed since I last used it normally yesterday afternoon?  Nothing other than rebooting the computer.
    Appreciate any help.

    This is usually solved by deleting your Acrobat preferences.  Since you did not state your OS I cannot give you the path to your preferences but there should be a doc in the knowledge base pointing you in the right direction.  Good Luck!

  • Acrobat Pro file open issues @ VDI

    While opening PDF file in Acrobat Pro 9 under the VDI user environment, the Acrobat starts and automatically simultaneously closes without any error message.
    Opening the same file in Acrobat reader becomes without any problems.
    We use VDI based on Citrix XenDesktop v.7.5;
    Hypervisor - VMWare vSphere v.5.0.1U1;
    MS AD - W2k8R2
    User Virtual machines based on OS Windows 7 (32 bit);
    All User files are stored on file server, which are provided by storage EMC VNX5400 and accessible through CIFS protocol. We user folder redirection for user folders

    Unsupported configuration: 12   Citrix Deployments — Enterprise Administration Guide.
    Ben

  • Acrobat Pro X Opens Every Document Directly to Page 2. WTF?????

    Hello. I updated to Acrobat Pro X and now when I try to open a PDF file from a link on my website, it automatically opens every document starting on Page 2, instead of Page 1 as I have set in "Properties"
    When I open the documents independent of the web browser, they open directly to Page 1, as specified.
    What gives?
    Anyone else having this problem?
    I think I might punch Adobe Acrobat right in its face as my customers are going to open the docs on my site and go "WTF????????!?!?!!?!?!?!?!?!?!!" and then poop their pants.
    What to do?

    I was having a similar problem, but only when viewing PDFs that were set to "fit page", and only when viewing in the browser.  "Fit width" PDFs worked fine.
    I am running Pro 9 but made the mistake of installing Reader X.  (This could explain why PDFs opened locally were fine, but those opened in a browser are not.)
    I finally uninstalled Reader X.  PDFs now open to page 1 properly.  Strangely, I didn't have to reinstall Reader 9... I guess it's now using Pro 9 to view in the browser?
    Not sure if this is a bug in Reader/Pro X or just a problem with having different versions of Reader and Pro on the same machine, but I thought I'd at least add a "me too" to the topic.

  • Acrobat Pro not opening PDF files when I double click on them- It only works if I bring up the program-.

    I've installed a trial version of Acrobat XI Pro. It will open the file if I hit control->open with->Acrobat Pro Luis: but if I double click on the document it only brings up the Acrobat XI Pro window with the "Open a Recent File", I've changed the "Open With" option on "Get Info" and still can't open the PDF files with a double click. Can anyone help me out? Thanks! LAGA

    When I double click the file after Acrobat is opened nothing happens...
    The PDF file only opens if I start the acrobat program then look for the PDF file or any PDF Files and then I am able to open them.
    What is going on
    Luis G. 
    Sent from my iPhone

Maybe you are looking for