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

Checkbox set in vba not set on reopen of form

Community Beginner ,
Apr 18, 2020 Apr 18, 2020

Hello I am setting these checkboxes programmatically in Excel  and on first pass they are set. However when I reopen the document after saving they are not set. I was wondering is there a way  to set them and keep them set the way I programmed them to be.

 

Code adapted from:

https://myengineeringworld.net/2013/10/read-and-write-pdf-forms-from-excel-vba.html

 

'All checkboxes to checked
objJSO.GetField(strFieldNames(22)).Value = 1
objJSO.GetField(strFieldNames(23)).Value = 1
objJSO.GetField(strFieldNames(24)).Value = 1
objJSO.GetField(strFieldNames(25)).Value = 1
objJSO.GetField(strFieldNames(26)).Value = 1
objJSO.GetField(strFieldNames(27)).Value = 1
objJSO.GetField(strFieldNames(28)).Value = 1
objJSO.GetField(strFieldNames(52)).Value = 1

TOPICS
Acrobat SDK and JavaScript
662
Translate
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
Community Expert ,
Apr 19, 2020 Apr 19, 2020

 

It would be helpful if you specify which part of the macro is this.

 

According to the the link where you grabbed  the code from there are two codes; One is for reading the PDF the other one is for writing to the PDF.

 

So when you say the first pass, does this mean that the ReadPDF portion of the code works but not the WritePDF code?

Translate
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 ,
May 07, 2020 May 07, 2020

It was the write section. To resolve the problem I recreated the form and that eliminated the issue. I was using the form straight from the VA.

Translate
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
Community Expert ,
May 07, 2020 May 07, 2020
LATEST

Hey that's great!

 

Thanks for sharing your feedback.

 

Don't forget to mark your answer as correct.

Translate
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