Programatically configure Office 2010 Word Ribbon via VBA

Maate picture Maate · Mar 23, 2011 · Viewed 13.3k times · Source

Is it possible to configure a Ribbon (e.g. adding a tab etc.) in Office 2010 programatically via VBA? I.e. by writing VBScript code in a macro.

Br. Morten

Answer

Todd Main picture Todd Main · Mar 25, 2011

You can manipulate a Ribbon tab and its controls using VBA, but you cannot create one. Not with the Object Model anyway. The best you could do - somehow - is to get some kind of OPC dll (like an ActiveX component) that handles opening/relationships/closing of OPC documents (like .docx documents) and old school MSXML for creating a ribbon definition and adding it to the package.