Freitag, 30. November 2007 15:41
The file styles.xml contains definitions of the default styles. How to access this via the SDK API?
The current 'parts' (e.g. MainDocumentPart or WordprocessingDocument) don't seem to contain the tags "wtyle" or "wtyles".
Where are they?! Do I have to go in through the package interface?
Freitag, 30. November 2007 15:43
Well! Just interpret the emoticon as meaning ":" followed by "s". That will teach me to preview...
Freitag, 30. November 2007 17:12If you apply "Heading 2" style to your text you can see following fragment in the document.xml (MainDocumentPart):
<w:rStyle w:val="Heading2Char" />
Samstag, 1. Dezember 2007 13:34
(by the way, thanks for answering - it's pretty quiet in here!)
what you say is true, but it doesn't answer the question. You can override style on an individual item (such as a run as in yxour example), but there is also a 'default' style which lives in styles.xml. The question is how to access the things in styles.xml programmatically. Ideally, I want to use the SDK. If I *have* to I will go through system.io.packaging (access the file as part of the zip).
My reason is that I want to validate that a given document has a certain style, and that it hasn't been changed.
Montag, 3. Dezember 2007 07:49
You could create a DOM on the part stream and access each style definition that way.
API doesn't provide more support on understanding each parts.
Donnerstag, 6. Dezember 2007 16:19
Yes, that was exactly what I was looking for. I hadn't realised the SDK imposed some kind of hierarchy on the files you see in the zip. So, you only get to the content of the Styles part, within the main document part.