

Second option is to use setText() method while loading the dialog with its controls. Type anything you want in Text property and it would be filled in TextBox. During design you can set any default Text for a TextField using Text property. There are two ways you can default a text in a TextField. How to insert or update the TextField textĭuring runtime, to update the contents of TextField, use setText() method. OTextField = oDialog1.getControl("TextField1")

It will return the input text as string from TextField. To read the text from TextField, use getText() method.

To add a TextField, click below icon and drag it to a new dialog. Macro Tutorial Index TextField – How to Add in a Dialog If you are looking for something else, head over to below link which contains all the LibreOffice macro tutorials covered: If you are unaware of the same, read below two tutorials before you proceed. This tutorial assumes that you know how to create a simple macro and a simple dialog.

This tutorial will show how to default a string, insert a string at runtime, reading the string from a TextField control using Basic macro.
