How to find styles and formats used in a paragraph?

B

Bill Hertzing

After reading many posts and blogs, I find plenty of examples of how to apply
a style or formatting to a range. I need the reverse - as I walk through the
paragraphs in a document, I need to find out the formatting applied to each
paragraph. I realize that this can get very complicated - imagine a paragraph
that has been given a specific style, then some words or even characters
within the paragraph are assigned specific character formats. I'm hoping that
someone here can provide examples or point me to further resources, so I can
figure out the programming model that Word uses to arrive at the visual
formatting that applies to each portion of the Word doc.

I am working on a LiveWriter plugin that will let a blogger open their Word
document, copy it all into the blog, and apply a style mapping that converts
the Word styles into a CSS-based format. I'm not trying for a automated
visual conversion. Instead, I want the plugin to support "mapping files",
that the user creates to map their own Word styles to CSS formats. I've much
of the plugin working (selecting and opening the Word document using PIA and
InterOp, selecting a mapping file, reading ranges from Word and inserting
them into LiveWriter) - but I really need to figure out how to read "which
styles (and/or formats) belong to which paragraphs". (Or do "styles and/or
formats" belong to Ranges? How I can tell if a style is being overridden by
specific formatting, for some portion of a paragraph or range?) As you can
see, I really need a better understanding of how styles and formatting are
assigend to sections of a Word Doc.

I'm targeting WLW Build 12.0.1370.325, and Word 2007, using VS2008 (C#) for
the plugin development.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top