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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word and vbscript

Status
Not open for further replies.

pinup

Programmer
Sep 10, 2001
3
GB
What are the arguments with the function word.selection.moveup to select a word or a line in a word document ?

Word.Selection.MoveUp ........

Thanks
 
From VBA for Word:

expression.MoveUp(Unit, Count, Extend)

expression - Required. An expression that returns a Selection object.

Unit - Optional Variant. The unit by which to move the selection. Can be one of the following WdUnits constants: wdLine, wdParagraph, wdWindow or wdScreen. The default value is wdLine.

Count - Optional Variant. The number of units the selection is to be moved. The default value is 1.

Extend - Optional Variant. Can be either wdMove or wdExtend. If wdMove is used, the selection is collapsed to the end point and moved up. If wdExtend is used, the selection is extended up. The default value is wdMove.
================
No way of choosing a word, sorry.

================
You have the whole help file for VBA for Word in CHM format in your computer - it comes with installation of MS Office.
Look in the directory C:\Program Files\Microsoft Office\Office\1033 (or where you have installed it)
and start VBAWRD9.CHM.

Success!
D.
 
Thanks but when I try in vbscript several permutations for
the three argument there is no effect.

Word.Selection.MoveUp 0,0,0
..................... 0,0,1
..................... 1,0,1
etc
 
I forgot to put the examples from the help file:
Selection.MoveUp wdParagraph, 2, wdMove
' moves the selection to the beginning of the previous paragraph.

Selection.MoveUp wdLine, 3, wdMove
' moves the selection up three lines

I thought that you will find them by yourself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top