We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

Writer document, macro to change field placeholder

asked 2021-01-27 07:24:56 +0200

halkul gravatar image

updated 2021-06-19 14:56:21 +0200

Alex Kemp gravatar image

hello, i ve an writer document with some fields type placeholder format text. the placeholder is empty, reference is for example street.i need to get the field reference "street" and change the placeholder "value" inside the macro

how can i change the placeholder value inside the macro?

i ve search hours, but found nothing about that.

thanks a lot!

edit retag flag offensive close merge delete


See chapter 5.18.2. Text Fields in the Pitonyak's book - there is Listing 5.48: Enumerate text fields provide by Heike Talhammer

JohnSUN gravatar imageJohnSUN ( 2021-01-27 08:17:02 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2021-02-03 12:37:00 +0200

halkul gravatar image

Thanks a lot, i ve found the answer:

    strsum = "com.sun.star.text.fieldmaster.SetExpression.sum"
if oDoc.getTextFieldMasters.hasByName(strsum) then
    oVar  = oDoc.getTextFieldMasters.getByName(strsum)
    oVar.DependentTextFields(0).content = sum
end if
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2021-01-27 07:24:56 +0200

Seen: 48 times

Last updated: Feb 03