I'm working on a Visual Studio 11 add-in. Through code, how can I detect when the current active document is saved? I don't know where to begin, and I couldn't find anything on the web about it.
Asked
Active
Viewed 1,086 times
1 Answers
4
I was facing the same problem with a VS10-addin and found this solution, hope this works for you as well...
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
_addInInstance = (AddIn)addInInst;
// Hook save changes event
_applicationObject.Events.DocumentEvents.DocumentSaved += DocumentEvents_DocumentSaved;
}

Derk van Lochem
- 56
- 1