
02-25-2015, 08:09 AM
|
Novice
|
|
Join Date: Feb 2015
Location: Dayton, OH
Posts: 4
|
|
Use multiple style sets in the same Word document (depending on which section the style is in)
I previously wrote up this question on superuser but haven't received much useful feedback as of yet. I am hoping I might have better luck here.
Quote:
I have a document "template" (not yet a template file type - I hope to create that as described below) for a report. The report is broken up into different sections:
Code:
Letter to the Client
Table of Contents
Section I
Title Page
Body
1.0
2.0
Section II
Title Page
Body
1.0
2.0
Appendix A
Title Page
Body
Appendix B
Title Page
Body
Each major "metasection" (Letter, Sections I and II, Appendices) has different formatting requirements.
In order to avoid having a huge number of styles (e.g. Normal - Letter, Normal - Sections, Normal - Appendices), it would be nice if I could have the same style name be different depending on which section of the document it is found in. Or said another way, I would like for a document to have multiple style sets depending on the section.
Just as an example of what I am after: for the Letter section, I would like Normal to be 10 pt Times New Roman, but in Section I and Section II, I would like it to be 11 pt Garamond. Or as a second example: the Title style should be left aligned on the letter, but centered in the appendices.
Is there a way to accomplish this?
EDIT:
From the comments below it seems like VBA would be the only option to do this. My initial idea on how this could be done would be:
The user simply applies the Normal style, Title style, etc, as necessary.
The VBA code would be written so as to have a style registry of corresponding Normals and Titles, etc., for each document section (Normal 1, Normal 2, etc).
Write a routine which iterates through the styles being used in the document, selects all the parts with that style, and applies the style from the registry depending on the section.
The routine is executed with a simple command button, or when the document is saved, or printed.
Any further additional suggestions or alternative ideas on this are appreciated.
(Apologies if this has been asked before; I searched for a similar question but couldn't find one. )
|
|