1

I wrote a macro in Publisher and have added it to my Quick Access Bar. Unfortunately, the macro only runs in the document that created it. In all other documents, the button does nothing.

Is there a way to make the macro run in all Publisher documents? I know Excel macros have an option of where to store them (personal workbook, this workbook, et.c) which changes this behavior. Is there a similar option for Publisher?

4
  • 1
    Is there an add-ins button in the developer tab of the Ribbon? If so, the answer is "yes". Feb 23, 2016 at 22:11
  • There is, but it accepts a .dll or a .exe. I'm assuming there's a simple way to compile a macro to a .dll?
    – ale10ander
    Feb 23, 2016 at 22:12
  • 1
    Not really. You'll want a VSTO add-in, written in C# or VB.NET and referencing the Publisher API. Simple, for some values of "simple" ;-) Feb 23, 2016 at 22:14
  • Thanks. It's not the ideal solution, but it should work. If you write it as an answer, I will accept it.
    – ale10ander
    Feb 23, 2016 at 22:16

1 Answer 1

1

If there's no "Publisher add-in" document type, then you need to write a COM add-in in C# or VB.NET with Visual Studio (i.e. not in VBA).

This article on MSDN blogs explains how to go about making an add-in for Access, given:

VSTO supports add-ins for most Office applications that support IDTExtensibility2-based COM add-ins, that is: Excel, InfoPath, Outlook, PowerPoint, Project, Visio and Word, but not for Access, FrontPage, Publisher or SharePoint Designer.

The process would be very similar for Publisher: reference the Primary Interop Assembly (PIA) to get a hold of the Microsoft.Office.Interop.Publisher.Application class, and you're pretty much all set - just design your Ribbon extensions, implement your functionality, compile, register, and you're up.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .