Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do I make a button visible from a macro?

During the processing of an add data form I am using a macro to determine based on the data entered whether a button should become visible. The button is named "bSODb". The code that I am using is includes the following (triggered by a different button):

    Me = oEvent.Source.Model.Parent
    Button = Me.GetByName("bSODb")
    ButtonCtrl = ThisComponent.CurrentController.getControl(Button)
    Msgbox ButtonCtrl.isVisible()
    ButtonCtrl.setVisible(True)
    Msgbox ButtonCtrl.isVisible()

The outcome of both Msgboxs is False, the button does not display, nor does it produce an error. What am I missing? (LO 5.2.7.2, OSX 10.12.5) Thanks.