Fundamental question on how to get the bits to work together: I've not used VSTO before and after 4 hrs of searching I've decided to ask!
I want to create a simple AddIn for word that will execute when the user saves ANY document.
I thought all I would need to do would be to create an AddIn in VisualStudio 2008, and put my code in the ThisAddIn class
Public WithEvents objWordApp As Word.Application
Private Sub objWordApp_DocumentBeforeSave(ByVal Doc As Word.Document, ByVal SaveAsUI As Boolean, ByVal Cancel As Boolean)
MsgBox("my addin code is running")
End Sub
and that would be that. Only this never gets run.
There is a clue here http://msdn.microsoft.com/en-us/library/bb221264.aspx that I have failed to declare the object, but I have no idea if this is what I am missing, or if it is, where that declaration code would go.