![]() |
|
#1
|
|||
|
|||
|
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
The OnAction property of the button is set to : Code:
'ReplaceTextWithMergeField "@PCIVIL", "PatientTitre"' Code:
Public Sub ReplaceTextWithMergeField(ByVal macroOrText As String, ByVal mergeFieldNameNew As String) 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() Thanks Last edited by ayomama; 07-27-2025 at 10:18 PM. |
| Tags |
| onaction parameters |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Public function string problem | JamesWood | Word VBA | 3 | 05-27-2021 11:55 PM |
| Calling a macro from a template using OnAction | sg11 | Word VBA | 2 | 04-30-2018 11:43 PM |
How to get the Right function to return a string that has UPPERCASE letters only
|
adj | Word VBA | 9 | 08-30-2014 09:21 PM |
.OnAction only works in document with the code
|
donbexcel | Word VBA | 1 | 11-02-2011 05:25 AM |
Macro or Function to know wether a string is included in a text
|
Eduardo | Word VBA | 5 | 06-15-2009 01:55 AM |