Select whole document, change font

A

achidsey

Word Experts,

I am new to Word programming and I just need to write a few procedures to
open a document, change the font style and size, and print it.

Using the macro recorder, I was able to make it work for one document, but I
don't know the command to select the whole document so that I can then change
the font. My code is below.

Sub PrintIncsum()

Documents.Open FileName:="T:\Statements\SLK Emails\Daily\is.txt"

Selection.MoveDown Unit:=wdLine, Count:=100, Extend:=wdExtend

With Selection
.Font.Size = 7
.Font.Name = "PrestigeFixed"
End With

Application.PrintOut FileName:=""

End Sub

What I need help with is how to replace
Selection.MoveDown Unit:=wdLine, Count:=100, Extend:=wdExtend
with code that will select the whole document, regardless of length.

What code will do this?

Thanks in advance,
Alan
 
H

Helmut Weber

Hi,

Selection.wholestory

if there aren't any headers or footers or
other storyranges apart from the mainstory,
which doesn't seem to be the case with "is.txt".

Still better would be, not to use selection at all, like

With ActiveDocument.Range
.Font.Name = "Arial"
End With



--
Gruß

Helmut Weber, MVP WordVBA

"red.sys" & chr$(64) & "t-online.de"
Win XP, Office 2003
 

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