VBA - Acrobat DC Pro - AFormAut - PopulateListOrComboBox

Hello

I'm trying to fill a combobox with wsh (or vba).

I get an "Invalid argument" error when calling PopulateListOrComboBox.

Can you help me with the correct syntax?

I tried with 1 or 2 arguments.

Ex code:

Sub test().

Dim oAcrobat

Dim oAVDoc

Dim oForm

Dim arr

Dim arr2

Dim oField

Set oAcrobat = CreateObject ("AcroExch.App")

Set oAVDoc = CreateObject ("AcroExch.AVDoc")

Set oForm = CreateObject ("AFormAut.App")

oAVDoc.Open 'C:\Dev\KExtAcrobat\ak.pdf', 'ak.pdf '.

ARR = Array ("1", "2")

Arr2 = Array ("1", "2")

Set oField = oForm.Fields.Item ("Dropdown1")

oField.PopulateListOrComboBox arr, arr2

Set oField = Nothing

Set oAcrobat = Nothing

Set oAVDoc = Nothing

OForm = Nothing set

End Sub

It's a bit tedious, but you can always do something like:

Dim oAcrobat

Dim oAVDoc

Dim oForm

Set oAcrobat = CreateObject ("AcroExch.App")

Set oAVDoc = CreateObject ("AcroExch.AVDoc")

Set oForm = CreateObject ("AFormAut.App")

oAVDoc.Open 'C:\Dev\KExtAcrobat\ak.pdf\ak.pdf', 'ak.pdf '.

oForm.Fields.ExecuteThisJavascript ' getField('Dropdown1').setItems ([['1', 'ExpVal1'] ['2', 'ExpVal2']]).

OForm = Nothing set

Set oAVDoc = Nothing

Set oAcrobat = Nothing

I remember a problem with the help of PopulateListOrComboBox of long ago, but can not locate any useful info now. I started using Fields.ExecuteThisJavaScript for the most part a long time ago because it works better. You can define variables and functions of JavaScripts at the level of the document or the file level to make it easier to manage.

Tags: Acrobat

Similar Questions

Maybe you are looking for

  • MacBook Pro 13 "(non-retine) is not responding"

    My MacBook Pro started to act weird last night after I tried to update my software on the App Store and applications. I can't even check to see what operating system I currently have, because my computer won't let me open anything. It has been quite

  • 22 Firefox work on Windows 7 Home Premium, but 23 failed

    I do this in Windows Explorer as Firefox will not work. Compatibility see the XP service pack 2. It does not list Windows 7 as a choice of a system that Firefox previously worked with. If I try to go back to Firefox 22 it says it's not not know who c

  • iTunes does not recognize the version of iOS iPhone 6sPlus

    Hello. My Itunes is telling me there is a new software for my Iphone 6sPlus (iOS9.2.1) when I connect it, even if it is updated to this version. No idea why? Thank you

  • Synchronize data when you call another VI

    Saying: I A.i and B.vi called B. I want to display a waveform to A and B collects data in a while loop. The question is how the waveform is updated in real time, then B is running? I tried global variables, but looks A.i isn't in the thread when you

  • MSVCR100.dll file

    How can I get the MSVCR100.dll file so I can run my Finale notation program without having to pay $99 for an answer? I have Windows XP Home Edition.