I am not familiar to OpenOffice Basic, but I need a simple macro code for setting document variables (user defined fields accessable under "field commands"/"Variables" in GUI) that I can assign to a button.
Example: I create a button A calling macro sub SetDocVar on a click, while SetDocVar sets the document variable/field MyField to string value "Test".
How does it work?