Hello everyone,
I have already added a dropdown menu and a button as an item of the dropdown menu to Word's ribbon using pre-ribbon era
Code:
Application.CommandBars("Standard").Controls.Add
Word adds the controls under a new "Add-ins" ribbon tab as expected.
The OnAction property of the button is set to :
Code:
'ReplaceTextWithMergeField "@PCIVIL", "PatientTitre"'
Here is ReplaceTextWithMergeField's signature:
Code:
Public Sub ReplaceTextWithMergeField(ByVal macroOrText As String, ByVal mergeFieldNameNew As String)
It is located in a module that does
NOT have the statement Option Private Module.
When I click the button I get this error message:
When I assign this parameter-less function (found in the same module) to OnAction instead, it works fine:
Code:
Public Sub Testing()
What am I doing wrong?
Thanks