Navigation
Office Open XML and Word Object Model Investigation image 1

Office Open XML and Word Object Model Investigation

C# API Microsoft Word ooxml

OOXML C# Microsoft Word API investigation

A future project requires that we find detailed information about content
elements in a Word document. Content elements can be found in various parts of the document, e.g., Main
Document, Header, Footer, Footnotes, etc.

Prior to opening a larger development project, we want to prioritise investigating
the biggest uncertainty, so this project
should achieve the following goal:

*We can only find the size of content elements within the XML of a Word file as
it is not available by just using the
Microsoft Office Object model. So we need to find a reliable method to reference
content elements in the XML that allow
the elements to be selected using the Microsoft Office Object Model when the
The document is open in Word. We'd like to
be able to display the size of each content element and also select it inside Word.

**We already do the following in PowerPoint with our add-in Slidewise, and we are
Looking for a similar result.
When we parse the XML, we get the name and ID of each shape, but the object model
doesn't provide any way to jump to
a shape based on its ID. There is a way to jump to a shape with a particular name,
but names aren't necessarily unique.
So when you double-click on a shape, Slidewise tells the object model to switch to
the appropriate slide and then
looks up the shape by name. If the shape it gets back has the correct ID, it selects that
shape, otherwise, it painfully enumerates every shape on the slide and checks each
In turn, until it finds the one with the correct ID and selects that.

C# API Microsoft Word ooxml
Back to Portfolio