Insert field in Writer document using a macro


I often need to insert a field in my document, and it’s always the same. I created a custom property in one of my templates, and whenever I need it, I have to do Ctrl-F2, then search for the field in the dialog window, and insert it.

I’m looking for a faster way. I tried recording a macro to get the gist of it and to do this. Since I’m always doing the same thing, I thought a macro would be a good way to go. I tried recording one, but the macro has nothing in it. I tried searching for a way to do that, but either nobody has asked the question, or I’m not using the right keywords.

Can anyone help?



You won’t expect to get a “macro” equally serving for all the types of fields (and probably their formatting) as the UI means do, but much more efficient, will you? I don’t think such a macro exists.

However, you probably didn’t realize till now that TextField(s) can be part of AutoText items. Prepare well shaped examples of what you actually want to use, and create AutoText items of them. Tow letters followed by an F3 can then do a lot for you.

1 Like

No, I did not know. Thanks, that’s just what I needed.