WD: WordBasic Macros to Select Different Document ElementsLast reviewed: February 2, 1998Article ID: Q94231 |
The information in this article applies to:
SUMMARYYou can use the Microsoft WordBasic macros and commands detailed below be to select the following document elements:
Word, Line, Sentence, Paragraph, Page, Section, Document MORE INFORMATIONThe following macros apply to Word versions 7.x, 6.x and 2.x unless noted otherwise.
Word 6.x, 7.x Command
SelectCurWord Word 2.x Select Word MacroThe following WordBasic macro selects the current word where the insertion point is located. The insertion point must be within a word and not positioned just before the word.
Sub MAIN SelType 1 WordLeft WordRight 1, 1 End Sub Select Line MacroThe following WordBasic macro selects the current line where the insertion point is located.
Sub MAIN SelType 1 EditGoTo "\line" End Sub Word 6.x, 7.x Command
SelectCurSentence Word 2.0 Select Sentence MacroThe following WordBasic macro selects the current sentence where the insertion point is located. The insertion point must be within the sentence and not positioned just before the sentence.
Sub MAIN SelType 1 SentLeft SentRight 1, 1 End Sub Select Paragraph MacroThe following WordBasic macro can be used to select the paragraph of text where the insertion point is located.
Sub MAIN SelType 1 EditGoto "\Para" End Sub Select Page MacroThe following WordBasic macro can be used to select the current page in your document.
Sub MAIN SelType 1 EditGoTo "\page" End Sub Select Section MacroThe following WordBasic macro can be used to select the current section in your document.
Sub MAIN SelType 1 EditGoTo "\section" End SubSelect Document Macro The following WordBasic command can be used to select all of the document text.
EditSelectAllThe SelType 1 command is used in the above macros to cancel an existing selection.
REFERENCES"Using WordBasic," by WexTech Systems and Microsoft, page 184 and 279.
|
Additional query words: winword2 winword word95 word7 paragraph word line
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |