Detecting Embedded Documents
-
Monday, July 09, 2012 3:00 PM
In a C++ Office addin that supports Office 2007 and Office 2010 for Word, Excel, PowerPoint, Visio and Project need to detect whether or not these document types are embedded in a parent document.
For instance, open a Word document. Within the Word document open an Excel document that exists as an Object in the Word Document. Edit the Excel document, Save. At the Save point and in the context of the Excel application is there a way to detect in C++ if that Excel document is embedded?
Note that for Word and Visio the "Container" property reliably detects if these document types are embeded. However, this does not work or is not available for Excel, PowerPoint and Project.
- Moved by Cindy Meister MVPMVP, Moderator Monday, July 09, 2012 5:20 PM C++ is not part of VSTO technology (From:Visual Studio Tools for Office)
All Replies
-
Thursday, July 12, 2012 5:35 AMModerator
Hi Jeff_20,
Thanks for posting in the MSDN Forum.
I will involve some experts into this issue to see whether they can help you. There might be some time delay, appreciate for your patience.
Have a good day,
Tom
Tom Xu [MSFT]
MSDN Community Support | Feedback to us
-
Thursday, July 19, 2012 5:47 PMModerator
Hi Jeff,
Please clarify the context of the add-in. Here is a list of situations upon which your question may or may not have an answer:
- When you load an instance of the application that your add-in targets, does the add-in load?
- If the application opens a file does the add-in load then?
- If the targeted document contains an embedded document (worksheet, PowerPoint presentation, Word document, etc. of a targeted application) does a second copy of the add-in load?
- If not, then when the end-user activates the embedded document so the parent application opens for either in-place activation or to run as the embedded document’s parent does the add-in load into the embedded parent’s application process so the PC now has 2 instances of the add-in’s .dll?
- Does the add-in have a way of determining whether the active document ( presentation, workbook, project, etc ) has an embedded object?
- Is the add-in a COM add-in that implements IDTExtensibility2 so that it can assign a pointer to the host application in a variable of the add-in? And if so, does it have code to do this?
If these questions miss the mark, please share more information about the situation that has lead to your question. Thanks.
Please remember to mark the replies as answer if they help and unmark them if they provide no help. and click "Vote as Helpful" this and other helpful posts, so other users will see your thread as useful. Best Regards, Chris Jensen

