?
Solved

Using Style Sheets with MS Word

Posted on 2012-12-27
5
Medium Priority
?
503 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 21

Accepted Solution

by:
Eric Fletcher earned 2000 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 15

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:Eric Fletcher
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 15

Author Comment

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

Author Closing Comment

by:DrTribos
ID: 38936880
Hi Eric,

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

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

741 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