Hi Ric,
Can you provide an example of the events needed for macro recording? Could they be abstracted to a common usage pattern?
And isn't there some kind of messaging/notification pattern that bridges the parts of a CAB application?
For a CAB application, you should create a seperate object model (class or classes), that represents the application UI, control logic and data you would expose to the VSTA add-in/macro. This is a challenge, because CAB properly isolates the UI from the control logic and data and your object model will probably want to re-unify these elements to some extent.
Rather than thinking of your object model in terms of UI pieces, think about it more in terms of the data presented by the UI and the operations performed on the data. So a list view on one of your forms would be bound to an underlying data structure (ie: arraylist) and this data structure would be exposed to VSTA in your object model with related methods, properties and events. Whatever notification CAB implements between the Shell and UI could also be tied to the object model component you create for VSTA.
I'm not familiar enough with CAB terms presently, but one idea would be to follow standard procedures to create an additional 'view' component similar to the a master form/view, but with no UI. This additional component becomes the object model portion of your CAB application. This object model portion could always be active and send/receive all the notifications via CAB architecture techniques. The object model would also expose events to VSTA and methods and properties the add-in will call to automate the application .
Rather than trying to tie everthing together in one OM, Another thought would be to offer many seperate object models scoped to particular forms or parts of the CAB application. These fractional object models would create seperate add-in assemblies that would load and unload according to the lifetime of the hosting component, probably all of the fractional OMs would include a common 'application' object model portion as a basis for communication with the rest of the host application.
Hope this chatter helps you in some way.