Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select all in word document 1

Status
Not open for further replies.

infinitelo

Programmer
Mar 7, 2001
319
I have a little script that opens a text file in word.
It changes the text to courier 8 , but only one paragraph at a time, and i cant seem to find the syntax to select the whole document in one shot.
It works fine for the short two pagers, but there is a 66 page document i would like to apply the script too. it just runs too slow.


if it is to be it's up to me
 
try

WholeStory Method
See AlsoApplies ToExampleSpecificsExpands a range or selection to include the entire story.

expression.WholeStory
expression Required. An expression that returns a Range or Selection object.

Remarks
The following instructions, where myRange is a valid Range object, are functionally equivalent:

myRange.WholeStory
myRange.Expand Unit:=wdStory

Example
This example expands myRange to include the entire story and then applies the Arial font to the range.

Set myRange = Selection.Range
myRange.WholeStory
myRange.Font.Name = "Arial"

This example expands myRange to include the entire comments story (wdCommentsStory) and then copies the comments into a new document.

If ActiveDocument.Comments.Count >= 1 Then
Set myRange = Activedocument.Comments(1).Range
myRange.WholeStory
myRange.Copy
Documents.Add.Content.Paste
End If


OR YOU CAN TRY THE .Expand as it applies to your version of Word
 
Very cool Thanks, I knew it was something like that
just couldnt get it on my own.




if it is to be it's up to me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top