Solved

Using Style Sheets with MS Word

Posted on 2012-12-27
5
496 Views
Last Modified: 2013-02-27
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
Comment
Question by:DrTribos
  • 3
  • 2
5 Comments
 
LVL 21

Accepted Solution

by:
EricFletcher earned 500 total points
ID: 38727189
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
 
LVL 14

Author Comment

by:DrTribos
ID: 38728488
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
 
LVL 21

Expert Comment

by:EricFletcher
ID: 38728787
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
 
LVL 14

Author Comment

by:DrTribos
ID: 38729860
Thanks Eric - will be interested myself  ;-)
0
 
LVL 14

Author Closing Comment

by:DrTribos
ID: 38936880
Hi Eric,

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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now