• Error message when re-purposing ribbon controls

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Error message when re-purposing ribbon controls

    Author
    Topic
    #484749

    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.

    Reply To: Error message when re-purposing ribbon controls

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: