Changing Documents Default Font?

I

i.d.gibbons

I'm doing a bit of work on some old word templates. One of the requests
is to modify the document so all the text is in Arial, at the moment
its in Times New Roman.

The new instance of a document is opened up by the following line.....

Set oDoc = Word.Document.Add(Template:="Normal", NewTemplate:=False,
DocumentType:=0)

This results in the whole document defaulting to Times New Roman. I've
tried to force a change in font at the end of the document by selecting
the "WholeStory" and changing the font using the selection.font.name
command....it simply doesn't work though. Therefore how can i achieve
the what i require?

I'm starting to think i could temporarily change the Normal template
style and revert back to its standard form at the end of the process?
Is that possible?

I'd be thankful of any advice.
 
S

Stefan Blom

Open each template as a document; then modify the style(s) directly.
For example:

Dim templatedoc as Word.Document
Set templatedoc = _
<ApplicationObject>.Documents.Open("template_path_and_name")

By default, most styles are based on the Normal style, so you should
be able to change all of those all in a single line:

templatedoc.Styles("Normal").Font.Name = "Arial"

But, alternatively, you could use the Styles collection to set the
font separately for each style:

For Each i In templatedoc.Styles
i.Font.Name = "Arial"
Next i
 

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