I am creating a web form that will do a 508 compliance check on word documents. I am looking through MSDN and other sites for getting the information I need from a file the user selects. The one thing I can’t find is how to find images, and check to see if they have alternative text. Any help would be GREATLY appreciated!
Share
Images inserted into 2007+ Word documents are
Drawingobjects. So you can traverse the XML forw:drawingmembers.http://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing.drawing.aspx
The
w:drawingmember will have a child calledw:inlinewhich is a part of theInlineclass.http://msdn.microsoft.com/en-us/library/documentformat.openxml.drawing.wordprocessing.inline.aspx
The
w:inlinemember will have a member calledwd:docPr.http://msdn.microsoft.com/en-us/library/documentformat.openxml.drawing.wordprocessing.docproperties.aspx
The
wd:docPrmember may have a field calledtitlewhich houses the alternative text title and a field calleddescrwhich houses all the alternative text.Example XML:
I highly recommend you use the OpenXML Productivity Tool that comes with the OpenXML SDK.