xTextField change text with UNO C++


Is there any way to change text in the xTextField? For example I added a custom xTextField in the .odt document, it called “Title” and I want to change the text in it with C++.

Something like

Reference xText = Reference(current_field, UNO_QUERY);

doesn’t work. Any suggestions?


My exact the same question on StackOverflow:

I posted the answer at c++ - Libreoffice API (UNO) : text and data from xTextField - Stack Overflow. If you ask in more than one place, please add links so people can follow your question.

done! I added a link. thanks for an advice