I am trying to “re-purpose” the buttons in the Controls group to insert content controls with pre-set properties. I have created macros to insert the custom controls, and they work. (In my example below, I’m repurposing the Date Picker Content Control.)
Here is the XML to customize the ribbon:
Here is the macro it calls:
Sub RibPIMSDateControl(control As IRibbonControl)
Selection.Range.ContentControls.Add (wdContentControlDate)
Selection.ParentContentControl.DefaultTextStyle = “Field Text”
Selection.ParentContentControl.DateDisplayFormat = “yyyy-MM-dd”
End Sub
When I load the template and click the button to insert a Date control, I get the error: “Wrong number of arguments or invalid property assignment.”
What am I missing?
Thanks in advance for any help you can provide.