Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I try to lock a field using: ActiveDocument.Fields("myField").Lock OR ActiveDocument.GetField("myField").Lock
without success. Do i make a mistake?
If i look the property CanLoc: ActiveDocument.Fields("myField").Canlock the result is false
How can i enable this?
in more if i look ActiveDocument.Fields("myField").GetLocked() OR ActiveDocument.Fields("myField").IsLocked
it's false
Make sure one or more values are selected in the field. Otherwise you can't lock the field.
There are no possibility to lock a field without value selected?
I need to lock the fields because the user can't select a value as there are a lot of field to lock i use a vb script
sub lockTESTFields
set flddescs = ActiveDocument.GetFieldDescriptions
for i = 0 to flddescs.count -1
fdesc = flddescs(i)
if InStr(1,fdesc.Name,"CCA")>0 then
'fdesc.Lock
ActiveDocument.Fields(fdesc.Name).Lock
temp=ActiveDocument.Fields(fdesc.Name).CanLock
'msgbox fdesc.Name&" "&temp
'MsgBox ActiveDocument.Fields(fdesc.Name).GetLocked()
if fdesc.IsLocked then
MsgBox "ok=="&fdesc.Name
'else
'MsgBox "NOK=="&fdesc.Name
end if
end if
next
end sub
if i load all the possible values for every field, i'm out of memory so my alternative is to lock every fiel one per one in parameter -> trigger at the open of the document