|
|
|
date: Wed, 24 Sep 2008 08:25:01 -0700,
group: microsoft.public.word.vba.general
back
Re: create VBA for prefix
Hi =?Utf-8?B?am8=?=,
> I want to create a macro to add to the toolbar in which the user can write
> down a prefix. This prefix should be used before all heading numbers and
> before all table and figure titles.
>
> Example prefix = 2.5
>
> Heading 1 becomes 2.5.1
> Heading 2 becomes 2.5.1.1
> Figure 1 becomes 2.5-1
> Table 1 becomes 2.5-1 etc
>
> I cannot do this in each seperate document template because we are talking
> about over 20 different documents with 20 different numbers, and all the
> other particulars for the template are the same (exept the "prefix")
>
> Is there a standard button for this in Word 2003?
> Can I create a macro, so that when the user hits a button it will ask to use
> a prefix or not and than implement it into the specific document?
>
I think the only way you're going to be able to do this and get a satisfactory
result (for Tables of content, etc.) is to take a slightly different approach.
Rather than Heading 1, Heading 3 should be applied in the document at the "top"
level, and so on. A couple of "empty paragraphs" need to be inserted at the
beginning of the document and formatted with Heading 1 and Heading 2. (They can
be formatted to be white, or very small, but as I recall you can't use
"hidden".) Set the numbering for those Heading levels to start at 2 and 5,
respectively.
Fiddle with this approach until you get something acceptable. Then you can use
a macro to set the numbering levels.
But if you're planning to later pull all these documents together in one file
you may want to do further testing before you decide to go this route.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
date: Thu, 25 Sep 2008 11:58:41 +0200
author: Cindy M.
Re: create VBA for prefix
Hi Cindy
Thanks for your thoughts. If I do like you advise I will get in my document
map those level headings (o.k. I can take them out, but this is more
difficult in the ToC) They will also interfere with links that are created
from the Word document when I transfere it into a pdf document. But the worse
thing for me is that I have got 90 documents and I do not like to create 90
templates that all have to be the same but for this little thing. If I ever
have to change one other thing in the format of the templates I would have to
do this 90 times.
At the moment I have created a macro that will ask the author for a document
number and this than will update the list that is used for the level heading
numbering. This seems to work. Next task is to get this macro into the
toolbar for the author to use.
Ofcourse I would never have been in this trouble if all authors could use
Word well, but let's face it your average Word user uses the program as a
typewriter.
Jolanda
"Cindy M." wrote:
> Hi =?Utf-8?B?am8=?=,
>
> > I want to create a macro to add to the toolbar in which the user can write
> > down a prefix. This prefix should be used before all heading numbers and
> > before all table and figure titles.
> >
> > Example prefix = 2.5
> >
> > Heading 1 becomes 2.5.1
> > Heading 2 becomes 2.5.1.1
> > Figure 1 becomes 2.5-1
> > Table 1 becomes 2.5-1 etc
> >
> > I cannot do this in each seperate document template because we are talking
> > about over 20 different documents with 20 different numbers, and all the
> > other particulars for the template are the same (exept the "prefix")
> >
> > Is there a standard button for this in Word 2003?
> > Can I create a macro, so that when the user hits a button it will ask to use
> > a prefix or not and than implement it into the specific document?
> >
> I think the only way you're going to be able to do this and get a satisfactory
> result (for Tables of content, etc.) is to take a slightly different approach.
> Rather than Heading 1, Heading 3 should be applied in the document at the "top"
> level, and so on. A couple of "empty paragraphs" need to be inserted at the
> beginning of the document and formatted with Heading 1 and Heading 2. (They can
> be formatted to be white, or very small, but as I recall you can't use
> "hidden".) Set the numbering for those Heading levels to start at 2 and 5,
> respectively.
>
> Fiddle with this approach until you get something acceptable. Then you can use
> a macro to set the numbering levels.
>
> But if you're planning to later pull all these documents together in one file
> you may want to do further testing before you decide to go this route.
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
> http://www.word.mvps.org
>
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)
>
>
date: Thu, 25 Sep 2008 08:28:10 -0700
author: jo
|
|