Hi Fabricio,

How can I hide a document text field using the API (without macros)?
Here“s the code that I use for accessing the textfield:

XTextFieldsSupplier xTextFieldsSupplier = (XTextFieldsSupplier)
UnoRuntime.queryInterface(
                                        XTextFieldsSupplier.class, component);

XNameAccess xNamedFieldMasters = xTextFieldsSupplier.getTextFieldMasters();

XEnumerationAccess xEnumeratedFields = xTextFieldsSupplier.getTextFields();

String completeName = "com.sun.star.text.FieldMaster.User." + textFieldName;

Object fieldMaster = xNamedFieldMasters.getByName(completeName);

the TextFields has a property called "IsVisible" ... setting this to false will hide your User-TextFields.

Somethings like

XPropertySet FieldProperties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xEnumeratedFields.nextElement())

FieldProperties.setPropertyValue("IsVisible",Boolean.FALSE)

should hide the first textfield in your enumeration ... that is if it is a User-Field ;-)

Hope that helps

Regards

Stephan


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to