Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2007

Tip: Looking for answers? Try searching our database.

Changing Documents Default Font?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
i.d.gibbons@googlemail.com - 08 Jan 2007 11:53 GMT
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.
Stefan Blom - 08 Jan 2007 12:51 GMT
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

Signature

Stefan Blom
Microsoft Word MVP

> 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
[quoted text clipped - 16 lines]
>
> I'd be thankful of any advice.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.