• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 505
  • Last Modified:

Using Style Sheets with MS Word

Hi All

Seasons greetings :-D  

I'm trying to make a template (.dotm) and anticipate a need for future customization and tweaking... I figured with Word 2010 that I should be looking at using style sheets and XML... I have close to zero experience with either...  a bit of searching on google and EE has not helped much.

I'd like my template to reference an external style sheet (or similar) so that text attributes and page layouts can be specified...

For example I have some data laid out in tables and might wish to change fill colors of the tables, table width, row breaking properties etc.  

Is this possible with Word 2010?

Would love some pointers to get me started...  failing this I guess I'll be creating an .ini file that contains my specifications and using VBA to apply all my formatting (so would appreciate thoughts on the best way forward too....)

Cheers, S
0
DrTribos
Asked:
DrTribos
  • 3
  • 2
1 Solution
 
Eric FletcherCommented:
A template with defined styles will do most of what you want. Certainly anything to do with text attributes is very easily managed by just modifying a style's definition. Page layouts and table row/column dimensions are not managed by styles, but if you have used styles, getting at parts to be modified (either manually, with VBA, or a combination of both) is much simpler.

If you are completely new to Word styles, I'd recommend reviewing Shauna Kelly's excellent tutorials first.

What you will want to do is establish a minimal set of styles to use to tag the different structures within your document. Typically, any document will be made up of headings, variations of a body paragraph (indented, not indented), lists (bulleted, numbered), and, in your case, parts within tables. Consider what attributes are common to the different elements so you can define the styles so that a change to a "master" element can use Word's style "based on" attribute to inherit the common parts. For example, say you set the Body Text style to be 12pt Helvetica, and had a Numbered List style based on it. If you change the Body Text style's definition to use 11pt Garamond, the Numbered List style would automatically change too.

To make changes to table dimensions, you can use Word's Find feature: click the small round button in the lower part of the vertical scrollbar to access the "Select Browser Object" flyout (or press Alt-Ctrl-Home), and choose the Browse by Table icon. This will bring you to the next table in the document, and you can make whatever changes you want. Click the double-down button below the browser object icon to skip to the next table.

The same method can be used to move from one scetion to another to make alterations to the page setup (since this is a section-related function).

Hope this helps get you on the right track...
0
 
DrTribosAuthor Commented:
Hi Eric

Thanks for your reply. I'm reasonably good with styles (and have gotten much out of Shauna's tutorials).  I've just started reading up on XML and CSS and doing tutorials at w3schools.com...

For practical reasons I don't really want to modify my template for each different user preference... too much work.  Ideally I would have a CSS (or CSS like file) that specifies styles, table borders, table backgrounds etc.. and any change made to the "file" would be reflected in the document next time it was opened.

I'm aware that there is an issue with MS using custom XML in documents but not sure how this relates to CSS...

At this stage I am thinking that I will need to use bookmarks for tagging...

   [tableTypeA_001], [tableTypeA_002], ... , [tableTypeA_00n]

   [tableTypeB_001], [tableTypeB_002], ... , [tableTypeB_00n]

And use VBA to apply specific formatting to my tables... etc.

Are you aware of any good tutorials out there for starting out with MS Word XML Schemas and/or XML Expansion Packs?  

Cheers,
0
 
Eric FletcherCommented:
Interesting idea... No, I'm not aware of any tutorials, but will certainly follow this thread to learn about them if they are available.

I don't use the built-in themes in Word, but perhaps they may use some sort of CSS to manage the various effects.
0
 
DrTribosAuthor Commented:
Thanks Eric - will be interested myself  ;-)
0
 
DrTribosAuthor Commented:
Hi Eric,

Closing this... thanks for your comments :-)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now