If your user interface is static, i.e. you do not need to programmatically change the behavior or add / remove user interface elements "on the fly", you can define customUI in a template with macro support. You can use your VBA functions as callbacks for interface elements defined in XML.
Check out this guide . In a nutshell, you define the customUI\customUI14.xml in the .dotm archive. This XML describes your custom feed elements using this schema .
This definitely works for Word templates (.dotm files). I think a similar approach works for any OOXML format.
source share