samedi 2 décembre 2023

Save PDF FormFields using VBA Excel

I've been writing values in the form fields from cell values in excel using VBA The problem is when it comes to checkbox, I have two checkbox, say checkbox 1 and checkbox 2. In order fot the checkbox1 to be marked the values of them must be 1 and 1 respectively For Checkbox2 to be marked, the values of the two checkbox must be 0 and 2 respectively I also have checkbox that is either 0 and 1 for it to be marked or not.

Whenever the program is done, you can check from the preview of the generated PDF file that markings are done correctly, but when you try to open it, values are there for text fields but the checkmarks are back to its default markings.

Is there something wrong with the values i stored for the checkbox.? I check the identification of the form field their type and values to get the right I.D. for the checkbox.

I tried writing it to 0 and 1 for on and off. Didn't solve the problem.

I tried going to PDF's Edit>Preferences>Documents> Checked "Save As Optimizes for Fast Web View"

I tried bringing it to front, automate left click and ctrl S, but it didn't work out

I simulated click on the boxes, and it is working fine.

Is there a way to get it right without simulating click?, because users might be using different dimensions in the screen, so it would be different target point for the click.




Aucun commentaire:

Enregistrer un commentaire