7 Replies Latest reply on Jul 13, 2012 9:49 AM by George_Johnson

    Pro 9 VBA/IAC field.Value = "abc" not working

    witkotl

      I've used this code with Acrobat Pro 7 with no problems. Upgraded to Pro 9 and the pdf form field value assignment no longer works:

       

      Set field2 = jso.Getfield("fieldA")

      field2.Value = "abc"

       

      There are no errors in vba or java console. I can read the pdf form field value wih no problem:

       

      msgbox field2.Value

       

      displays the pdf form field value in my vba application, (MS Access)

       

      Are there any settings in Pro 9 that prevent writing to form fields through IAC?

       

      Thanks in advance!

        • 1. Re: Pro 9 VBA/IAC field.Value = "abc" not working
          ReinhardF Level 3

          Hi,

           

          with a standard acrobat form it works furtheron in 9.2. Pro.

           

          HTH, Reinhard

           

           

          Test.vbs

          -------------------------------

           

          '/ set objects for working with an active/opened doc
          Set AcroApp = CreateObject("AcroExch.App")
          Set AVDoc = AcroApp.GetActiveDoc
          Set PDDoc = AVDoc.GetPDDoc
          Set jso = PDDoc.GetJSObject

           

          '/ get and set value
          x = jso.getNthFieldName(6)
          set f = jso.Getfield(x)
          msgbox(f.Value)
          f.value = "NewValue"

          • 2. Re: Pro 9 VBA/IAC field.Value = "abc" not working
            witkotl Level 1

            Dear ReinhardF,

             

            Thanks for the information. I’m using Pro 9.4. I’ve also noticed an error

            message in the console when the doc opens, (doc authored and locked down by

            another group so I can’t look at code). Could this javascript error be

            stopping further vba/acroexch execution?

             

            Note – this error displayed before I try running my VBA code.

             

             

             

             

             

             

             

            Thanks for any additional advice.

             

            Tyler

             

             

             

            Tyler Witko

             

            Director Trial Documentation, Clinical Operations

            Boehringer Ingelheim Pharmaceuticals Inc.

            Office: 203 778-7617 (x 57617)

             

            Cell: 203 417-9173

            • 3. Re: Pro 9 VBA/IAC field.Value = "abc" not working
              George_Johnson MVP & Adobe Community Professional

              What is the exact text of the error message?

              • 4. Re: Pro 9 VBA/IAC field.Value = "abc" not working
                witkotl Level 1

                Hi George,

                 

                Thanks for the reply – there is no error message in the vba runtime in

                Access. The pdf form I’m trying to write to does display an error when it

                initiates and I’m wondering if this is stopping the vba code from working

                after the form is open. Here’s the pdf console message generated when the

                form opens:

                 

                 

                 

                 

                 

                 

                 

                Thanks in advance for any ideas/suggestions.

                 

                Tyler

                 

                 

                 

                Tyler Witko

                 

                Director Trial Documentation, Clinical Operations

                Boehringer Ingelheim Pharmaceuticals Inc.

                Office: 203 778-7617 (x 57617)

                 

                Cell: 203 417-9173

                • 5. Re: Pro 9 VBA/IAC field.Value = "abc" not working
                  George_Johnson MVP & Adobe Community Professional

                  It looks like you answered via email and attempted to add an attachment. The problem is email attachments don't come through, so I can't see it. Try logging on via the forums and you can include an image, if that's what it was.

                  • 6. Re: Pro 9 VBA/IAC field.Value = "abc" not working
                    witkotl Level 1

                    Hi George,

                     

                    Here’s js console error message the pdf initiation is showing:

                     

                     

                     

                    Exception in line 45 of function top_level, script XFA:BIForm[0]:initialize

                     

                     

                     

                    NotAllowedError: Security settings prevent access to this property or method.

                     

                    SOAP.connect:45:XFA:BIForm[0]:initialize

                     

                     

                     

                    Would this impact other js calls to document, (i.e. vba/acroexch)? If yes, is

                    there a way to ‘reset’?

                    • 7. Re: Pro 9 VBA/IAC field.Value = "abc" not working
                      George_Johnson MVP & Adobe Community Professional

                      So it looks like you're dealing with an XFA form, which are usually created in LiveCycle Designer. Do you know if it's static or dynamic? You'll likely have problems with dynamic forms, and maybe static forms, as the JavaScript you're using is intended for acroforms create in Acrobat. You can try using the same JavaScript code as you'd using in an XFA form. If you need help with that, it might be best to post in the LiveCycle Designer forum.