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
Application
instance is passed to theOnConnection
method implemented in your code. Depending on the host you could use the Saved property, for example, in case of Word theDocument
class provides theSaved
property which returnstrue
if the specified document or template has not changed since it was last saved.False
if 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
true
if 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.