Hi, I use the following code VB6 and sets the form field to read only using Flag of 1, and if I use 0, it does not reset, well, I don't know where to find the flags argument in the documentation.
Dim nFieldsCount As ULONG_T
Dim i As ULONG_T
Dim myString As Variant
Dim Doc As PDFXEditCtl.IPXV_Document
Dim FFlag As PDFXEditCtl.PXC_FormFieldFlag
Dim FType As PDFXEditCtl.PXC_FormFieldType
Dim FSigFlag As PDFXEditCtl.PXC_FormSigFlag
Set Doc = Me.PDF.Doc
FFlag = FFF_ReadOnly
nFieldsCount = Doc.CoreDoc.AcroForm.FieldsCount
For i = 0 To nFieldsCount - 1
Doc.CoreDoc.AcroForm.Field(i).SetFlags FFlag, 1 '1 = true
'but if you try 0, does not remove the flag.
Doc.CoreDoc.AcroForm.Field(i).SetFlags FFlag, 0
'also tried this and nothing happens, does not clear the text either of the readonly field
Doc.CoreDoc.AcroForm.Field(i).Reset
Next i
Flags for setting ReadOnly Form Fields SOLVED
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 211
- Joined: Sun Aug 05, 2012 5:20 pm
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Flags for setting ReadOnly Form Fields SOLVED
Hello prime clinical systems,
You are not using this method correctly:
https://sdkhelp.pdf-xchange.com/vie ... d_SetFlags
Here's what the mask is:
https://en.wikipedia.org/wiki/Mask_(computing)
In this case, the code set would remove the flag will look like this:
Cheers,
Alex
You are not using this method correctly:
https://sdkhelp.pdf-xchange.com/vie ... d_SetFlags
Here's what the mask is:
https://en.wikipedia.org/wiki/Mask_(computing)
In this case, the code set would remove the flag will look like this:
Code: Select all
SetFlags(0, FFF_ReadOnly);
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 211
- Joined: Sun Aug 05, 2012 5:20 pm
Re: Flags for setting ReadOnly Form Fields
ah ok, thanks, glad it was simple, but seems should fire some error, as it does work with 1 reversed.
and documentation shows it the way I have it, says flags first, followed by mask.
Syntax
HRESULT SetFlags([in] ULONG nSetFlags,
[in] ULONG nMask);
Parameters
nSetFlags
[in] Value of ULONG containing the flags that need to be set.
nMask
[in] Value of ULONG containing the flag settings mask.
ce
and documentation shows it the way I have it, says flags first, followed by mask.
Syntax
HRESULT SetFlags([in] ULONG nSetFlags,
[in] ULONG nMask);
Parameters
nSetFlags
[in] Value of ULONG containing the flags that need to be set.
nMask
[in] Value of ULONG containing the flag settings mask.
ce
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Flags for setting ReadOnly Form Fields
Hello Clifford,
No error should be returned in this case. As far as I remember, the S_FALSE HRESILT is being returned as the mask is 0 which means there is nothing to modify.
Cheers,
Alex
No error should be returned in this case. As far as I remember, the S_FALSE HRESILT is being returned as the mask is 0 which means there is nothing to modify.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 211
- Joined: Sun Aug 05, 2012 5:20 pm
Re: Flags for setting ReadOnly Form Fields
Hi well you gave me this code,
SetFlags(0, FFF_ReadOnly);
and I was just trying to point out that the documentation says SetFlags(Flags, Mask)
unless I don't understand the documentation, anyway thanks for correcting, will try it reversed
CE
SetFlags(0, FFF_ReadOnly);
and I was just trying to point out that the documentation says SetFlags(Flags, Mask)
unless I don't understand the documentation, anyway thanks for correcting, will try it reversed
CE
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Flags for setting ReadOnly Form Fields
Hello Clifford,
The documentation is correct - passing 0 as flags and some value as mask means that this bits' value should be 0 in overall Flags of the object. Anyways glad that it worked for you.
Cheers,
Alex
The documentation is correct - passing 0 as flags and some value as mask means that this bits' value should be 0 in overall Flags of the object. Anyways glad that it worked for you.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ