Skip navigation
Currently Being Moderated

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

Jul 10, 2012 8:59 PM

Tags: #vba #acrobat_pro_9 #iac #jso.getfield("a")

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!

 
Replies
  • Currently Being Moderated
    Jul 11, 2012 2:20 PM   in reply to witkotl

    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"

     
    |
    Mark as:
  • George Johnson
    9,207 posts
    Aug 11, 2002
    Currently Being Moderated
    Jul 12, 2012 10:44 AM   in reply to witkotl

    What is the exact text of the error message?

     
    |
    Mark as:
  • George Johnson
    9,207 posts
    Aug 11, 2002
    Currently Being Moderated
    Jul 12, 2012 1:09 PM   in reply to witkotl

    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.

     
    |
    Mark as:
  • George Johnson
    9,207 posts
    Aug 11, 2002
    Currently Being Moderated
    Jul 13, 2012 9:49 AM   in reply to witkotl

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points