trouble with Style and formatting in template

A

Associates

Hi,

I am having issue with style and formatting in word 2002. What i was trying
to do is to create a template that would generate a standardized report. By
standardized i mean it includes the standard style, font size and other
settings.

Anyway, i call that template a report template. In this report, i have a
several macros button appear on the top menu bar.

We have three kind of reports we would like to generate from this "report
template". None of them have the header/footer. The only difference between
them is the style

With first report
- Let us say the title of the heading is Introduction. Hence, when macro1 is
run, it shows as below in the report

Introduction

With second report, macro2
When macro2 is hit, it generates as below

1. Introduction

With third report, macro3
macro3 will show as below

Chapter 1 Introduction

So these are the differences among the three reports. Now, what i have done
is i have created three templates with three different styles respetively.

For the first template, it has the first report with the properties as follows
Name: MyHeading1
Style based on: (no style)
Style for following paragraph: Normal
Garamond, 16 size of font, Bold, black color

The second has the second report with the following style properties
Name: My1Heading1 ( I call it 1Heading1 simply because it starts with number
1 at the front)
Style based on: (no style)
Style for following paragraph: Normal
Garamond, 16 size of font, Bold, black color

The third has the third report with the following style properties
Name: MyC1Heading1 ( I call it C1Heading1 simply because it starts with
Chapter 1 at the front)
Style based on: (no style)
Style for following paragraph: Normal
Garamond, 16 size of font, Bold, black color

Then, I inserted them to autotexts with Look in "Normal.dot"

The problem i have is that when i run macro1. It is supposed to produce a
report with just the Heading1 (e.g. Introduction) but instead, it shows the
My1Heading1 (e.g. 1. Introduction). And when i noticed in the Style and
Formatting, it added 1 in the front of My1Heading1 such as "1 My1Heading1".

I think word detects the similarity between them and assume they are the
same and adds 1 as another copy of the same style. What i do not understand
is that why it is doing that when i call them each with different name.

The following codes i use to insert autotext via VBA
'Call autotext My1Heading1

ActiveDocument.AttachedTemplate.AutoTextEntries("My1Heading1").Insert _
Where:=Selection.Range, RichText:=True

With ActiveDocument
.Fields.Update
.PrintPreview
.ClosePrintPreview
End With

I wonder if anyone would like to share with me way of working around this
issue.

Thank you in advance
 
S

Stefan Blom

You should ask this question in a programming newsgroup such as
microsoft.public.word.vba.general instead. There you are more likely to get
knowledgeable help.
 

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