Update a Text Field

I have a field:
Type: Variable
Name: ClientName
Format: Text

The field is already within the .odt document, with the default value set to “Name”
I would like to update this value to a given client name (string value) “John Smith”

I have already checked out a lot of documentation and having no luck…
I imagined it would be something along these lines:
NameField = Doc.getTextFieldMasters().getByName(“ClientName”)
NameField.Content = “JohnSmith”

You have posted this question in the OpenOffice forums and received a solution,

For those interested the answer is at [Solved] Selecting and Updating a Text Field (View topic) • Apache OpenOffice Community Forum