RenameFormField
Form fields
Description
Renames a form field by its fully-qualified name without requiring the caller to resolve the field index first. OldName is resolved to a 1-based field index and the field's title is replaced with NewName
Syntax
Delphi
Function TPDFlib.RenameFormField(Const OldName, NewName: WideString): Integer;
Parameters
| OldName | Fully-qualified name of the field to rename |
|---|---|
| NewName | New fully-qualified title for the field |
Return values
| 1 | A field matching OldName was found and its title updated |
|---|---|
| 0 | No field matches OldName or the document has no form data |
Remarks
Only the first field matching OldName is renamed when several fields share the name
The new title becomes the field's fully-qualified name, so keep the parent-child spelling, for example Parent.Child, to leave the field inside its hierarchy
See also
SetFormFieldTitle, FindFormFieldByTitle, RemoveFormFieldByName, NewChildFormField