Change a Fillable Field to Read Only Using VBA

jefff34942432

15-07-2020

Hello

 

I have a form that was created in LiveCycle (not by me)

 

The Form is a fillable form that is protected (I cant make changes to the form itself)

 

What i am trying to do is to populate the fillable form fields from Excel or MSAccess using VBA -- this part I have solved - I am able to populate every field that I want to using VBA

 

What I am trying to now do is to Make some of the fields that I just populated as Read Only - so that when I save the file and send it to someone else - the fields that I just filled in will not be editable

 

I have tried this code

jso.getfields("LAB1070E[0].Page1[0].txtF_3_EmployNameAdd[0].ReadOnly = True

 

The code does not produce any errors - but it does not actually make the field Read Onl

 

I have Tried

jso.xfa.resolvenode("forms.LAB1070.Page1.txtF_3_EmployNameAdd").rawValue = "1234"

 

This works to change the value - and seems to be the proper syntax for working with LiveCycle built forms - my questions is:

 

It is even possible to change the Read Only status of a Form Field using VBA so that when you save the PDF the field will actually be Read Only

 

What is the proper syntax to use

 

Any assistance or thoughts on this would be greatly appreciated 

 

Thanks

 

Jeff

Read Only VBA

Accepted Solutions (0)

Answers (1)

Answers (1)

Kosta_Prokopiu1

15-07-2020

Hi,

 

I have never used VBA to set XFA form fields from a VB script.

But this would be the syntax to change the access to that field - maybe that works via this interface as well:

jso.xfa.resolvenode("forms.LAB1070.Page1.txtF_3_EmployNameAdd").access = "readOnly"

 

for more access options (should this work) see here: https://help.adobe.com/de_DE/livecycle/11.0/DesignerScriptingRef/WS92d06802c76abadb-3e14850712a151d2...

 

Kosta