> Hi Jonathan,
>
> Can you show me how to define a range object to used as Selection?
> FYI, my program is doing find and replace on the document, can i still
> use range object?
Do something like this (where you have defined oDoc as I described in my
previous post)
Dim oRange as Range
Set oRange = oDoc.Range 'Range object now marks the whole of Doc2
With oRange.Find
'set up your find code here as if you used "With Selection.Find"
End With
Having defined a Range object variable, you can do almost anything with it
that you can do with the Selection. There are a few exceptions, for instance
you can't use a Range to select a column of a table. But there are
workarounds for those cases if and when you come up against them.
> And also, please kindly explain what did you mean by "To avoid using
> ActiveWindow, define a Window object based on oDoc "? Can you show me
> example?
Dim oWindow As Window
Set oWindow = oDoc.Windows(1)
Then you can use oWindow in the same way that you used ActiveWindow. oWindow
will remain the window associated with oDoc even if the user changes which
document is active and therefore changes which window is the ActiveWindow.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
jCheah@iso.com - 20 Jul 2007 20:28 GMT
Hi Jonathan,
Can Range object do some simple tasks like the following? as I couln't
find the MoveRight, MoveLeft, MoveUp or MoveDown properties under
Range Object.
.Selection.MoveRight unit:=wdCell
.Selection.MoveLeft unit:=wdCharacter, Count:=2, Extend:=wdExtend
Please advise.
Russ - 21 Jul 2007 12:16 GMT
.move for range
See VBA help for move
Some things only work with selection, but you can use myRange.Select to make
myRange the selection.
> Hi Jonathan,
>
[quoted text clipped - 7 lines]
>
> Please advise.

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID