• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Use VBA to get a dropdown list value

New Here ,
Mar 20, 2020 Mar 20, 2020

Copy link to clipboard

Copied

Hello All,

I am using the JSO object and get field method to retrieve the values of dropdown lists from a form and place them into a variable which is then placed in a spreadsheet. In the following code the mobjJSO has already been initialized.  The value of the array is the name of the dropdown list  that is Skill_1.  I have confirmed the name and that it is on the PDF form.  I have other dropdowns that this appears to work correctly to bring back the value, but for this one I actually get the number of item that was chosen in the listing instead of the text.  For instance, if the user chose Data Entry below returns a 2 for the second item in the list instead of "Data Entry".  Does anybody know what I am doing wrong?  I just can't seem to get this to work.  

strValue = mobjJSO.getField(mobjLookupArray(i, 0)).Value  

Thank you!

Thayana

TOPICS
Acrobat SDK and JavaScript

Views

402

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 23, 2020 Mar 23, 2020

Did you check the export values in the list?  This is what is returned as the value of the list field. 

Votes

Translate

Translate
Community Expert ,
Mar 23, 2020 Mar 23, 2020

Copy link to clipboard

Copied

Did you check the export values in the list?  This is what is returned as the value of the list field. 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 25, 2020 Mar 25, 2020

Copy link to clipboard

Copied

LATEST

Thanks! That was it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines