Access the Text Box by the Name
Contents
[
Hide
]
Earlier, text boxes are accessed by index from the Workheet.getTextBoxes() collection but now you can also access the text box by name from this collection. This is a convenient and quick way to access your text box if you already know its name.
Access the Text Box by the Name
The following sample code first creates a text box and assigns it some text and name. Then in the next lines, we access the same text box by its name and print its text.
Console Output
Here is the console output of the above sample code.
This is MyTextBox