How to Hide Acrobat When Running VBA Code

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default How to Hide Acrobat When Running VBA Code

    I am using Acrobat 9.

    My project adds text to Acrobat fillable fields using VBA written in Access 2003. I take records from my Access database, and populate it into different Acrobat Forms based on the field name in the Acrobat Form. I am able to do this, but there is one problem.

    The problem is that as the code runs through populating text in the Acrobat Forms, Acrobat opens up each form, and makes it visible to the user. It populates quick, but it is still visible. I want this to run in the background, or at least be minimized in the windows taskbar. The users should not not know which form the Application is updating. It should be hidden or invisible. That is the goal at least :)

    I know which line in the code causes it to Maximize, but if I remove that line, I receive an error about No Document Currently Open in Acrobat Viewer.

    Here is the snippet of the code I am using. Any help would be greatly appreciated.

    Dim gApp As Acrobat.CAcroApp
    Dim avdoc As Acrobat.CAcroAVDoc
    Dim gPDDoc As Acrobat.CAcroPDDoc
    Const DOC_FOLDER As String = "C:\Trial"
    Dim x As Boolean

    Set gApp = CreateObject("AcroExch.App")
    Set gPDDoc = CreateObject("AcroExch.PDDoc")
    Set avdoc = CreateObject("AcroExch.AVDoc")

    'Hides Acrobat - So Far So Good
    gApp.Hide

    Dim FormApp As AFORMAUTLib.AFormApp
    Dim AcroForm As AFORMAUTLib.Fields
    Dim Field As AFORMAUTLib.Field

    'Open PDF that I choose. Acrobat still has not flashed on my screen
    x = avdoc.Open(DOC_FOLDER & "\trial.pdf", "temp")

    'Acrobat Now Pops up on my screen. However, I get an error without this line. avdoc.Show works the same as Maximize it seems.
    avdoc.Maximize(1)

    'Hides it again, right after it opens. This creates a flash
    gApp.Hide

    Set FormApp = CreateObject("AFormAut.App")

    'If the Maximize line is not there, this is where I receive error about document viewer
    For Each Field In FormApp.Fields
    If Field.Name = "Sample_FieldName" Then
    Field.Value = TextToUse
    End If
    Next

    Please let me know if you can think of a way to keep Acrobat hidden. Thank you.
    Kevin_Ha@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Hide Acrobat When/After Printing PDF with printdialog
      I'm having the same issue. The external window shows up regardless if I'm trying to use OLE (printwithdialog) or even an own plugin...
    2. Where does Adobe now hide Mac Acrobat 7 for buying/downloading??
      I searched the site and can find NO place where one can now buy Acrobat 7. All such links now direct you to Acrobat 8. BAD DESIGN! And since Adobe...
    3. how do i hide FireWorks code for drop downs
      I am trying to hide or create a direct link for my fireworks drop down menu so that it doesn't show up in the source code of all of my pages. I...
    4. Hide Acrobat Toolbar & Menu in Visio
      Is there a way to hide the Acrobat toolbar and menu in Visio. For the toolbar, I can turn it off, but the next time I open a drawing it comes back. I...
    5. Hide code form other FTP users
      Hi Whilst browsing the MSDN on day, I am sure I saw an article on 'How to encode your ASP code within the asp page', but I can not find it...
  3. #2

    Default Re: How to Hide Acrobat When Running VBA Code

    Use standard VB/Windows features to minimize the app.
    Leonard_Rosenthol@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139