Update Inherited Template

G

Gordzilla

I've been asked to update an existing Word template.
Currently when a button on a custom Toolbar is pressed, the documents
created from the template are modified and the following text is added
"EAOC REFERENCE:"
By stepping through the VBA code I've figured out that this line adds the text

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldListNum,
Text:= _
" new_frontheadings \l 9 "
I've been asked to change the text to read:
"COA REFERENCE:"

I've searched the template and the underlying VBA and the text doesn't exist
anywhere.

I'm relatively new to VBA in word. Can anyone point me in the right
direction to make this change?

Gordzilla
 
S

Stefan Blom

You will have to modify the list template inserted by the statement you
quoted. Assuming that the LISTNUM field adds only the text, not a number,
the following modification should work correctly:

ActiveDocument.ListTemplates("
new_frontheadings").ListLevels(9).NumberFormat = "COA REFERENCE:"

If an outline number is also inserted by the field, you may want something
like this instead:

ActiveDocument.ListTemplates("
new_frontheadings").ListLevels(9).NumberFormat = "COA REFERENCE: %9"

You may want to test this on a copy of the document first, to make sure that
nothing unexpected happens.

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 

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