Expand my Community achievements bar.

Change a Fillable Field to Read Only Using VBA

Avatar

Level 1

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

3 Replies

Avatar

Employee

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

Avatar

Level 1

Thanks kprokopi

 

I tried that and it does not seem to work in VBA

 

I appreciate your response!

 

Jeff

Avatar

Employee
Maybe you can approach it differently. A readonly field in XFA can still be set a rawValue. If you change your form design to have these fields be readOnly you can still change their values via VB?