The MSDN site describes the stylesWithEffects part (new in Word 2010) as a copy of the Styles part (http://msdn.microsoft.com/en-us/library/dd908153(v=office.12).aspx). Can anyone shed any additional light on this? This appears to be either inaccurate or incomplete because I've seen an example where the two parts are not identical. Also, I don't understand why two copies of the styles would even be desirable. Wouldn't that just bloat the file?
Thanks for your help.
The stylesWithEffects part exists to allow round-tripping with prev versions of Word. If you use some styles supported only by 2010 then open and save with 2007 then 2007 will strip the fancy styles out of the styles part. Having the stylesWithEffects part enables 2010 to rehydrate the stles part with the fancier styles. I have a screencast planned.
Thanks Eric. That's exactly the kind of information I was looking for. I'll look forward to seeing your screencast.
Is there anywhere to find more detailed information on how Word 2010 uses the stylesWithEffects part?
For example, I created a style in Word 2010, opened the styles and stylesWithEffects parts, and moved the style I created from the styles part to the stylesWithEffects part. When I opened the document again in Word 2010, the style was ignored, or at least it no longer appeared in the Styles pane, and no longer applied to the main document content.
What kinds of styles does Word use stylesWithEffects for? If I'm adding a style to a document, how do I know which style part it needs to be inserted in? And if the style comes from a different document, should it always be inserted into the same kind of part it came from?
Thanks again for your feedback.
For almost all practical purposes, you can ignore the stylesWithEffects part, and simply generate a styles part. If you are pulling a style from another document, you can always put it in the styles part.
The stylesWithEffects screen-cast is still on my list - I'm hoping I'll get to it this month.
Thanks Eric, this sounds good. The only word that troubles me here is "almost". I'm worried about the exception that might bite.
In any case, it sounds like as a general rule, when merging a "child" document into a parent document, all styles from the child document's style part should be merged into the parent document's style part; all styles from the child document's stylesWithEffects part should be merged into the parent's stylesWithEffects part; and all styles from the child's stylesWithEffects part that are not already merged from the child's styles part into the parent's styles part should also be merged into the parent's styles part (although I'm not entirely certain about this third case).
Interestingly, I tried creating a style with text effects in Word 2010 which I then opened and saved in Word 2007. Then I opened the same document back up in Word 2010. While the text effects were indeed preserved in the stylesAndEffects part, I didn't see how that preservation was manifest in Word 2010.
I'm very much looking forward to your screen-cast.
Have a great day!
I answered the "how that preservation was manifest in Word 2010" question by clicking on the Convert button in the Info section of the File tab. That button converts the file back to Word 2010. When Word converts the file to 2010 format, it applies the styling information in stylesWithEffects part.
I've recorded a video that shows exactly how the stylesWithEffects part works.