I have created a basic COM add-in for MS office apps like Word, PPT, Excel in Visual C++ using _IDTExtensibility2 interface.
Now i want my add-in to find if Word, PPT, Excel has any unsaved changes.
FYI: I have not chosen VSTO or Office JS add-in due to dependency/deployment reasons.
Kindly provide solution in C++.
An Office host
Applicationinstance is passed to theOnConnectionmethod implemented in your code. Depending on the host you could use the Saved property, for example, in case of Word theDocumentclass provides theSavedproperty which returnstrueif the specified document or template has not changed since it was last saved.Falseif Microsoft Word displays a prompt to save changes when the document is closed.In case of Excel you can use the Workbook.Saved property which returns
trueif no changes have been made to the specified workbook since it was last saved.In case of PowerPoint the Presentation.Saved property determines whether changes have been made to a presentation since it was last saved.