Article ID: 212529 - View products that this article applies to.
This article was previously published under Q212529
This article describes how to select the current paragraph (the one that contains the insertion point) by using Microsoft Visual Basic for Applications macro code.
NOTE: You can select a paragraph in Microsoft Word without the use of a macro when you triple-click with your mouse anywhere inside the paragraph.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
For more information about how to use the sample code in this article, click the article number below to view the article in the Microsoft Knowledge Base:
212536In Microsoft Word, you can use one of the following alternative methods to select the current paragraph, by using Visual Basic for Applications macro code.
(http://support.microsoft.com/kb/212536/EN-US/ )OFF2000: How to Run Sample Code from Knowledge Base Articles
Method 1: Use the GoTo MethodYou can use the GoTo method of the Selection object to select the current paragraph, as in the following Visual Basic statement:
Method 2: Use the StartOf and MoveEnd MethodsYou can use the StartOf and MoveEnd methods of the Selection object to select from the beginning to the end of the paragraph, as in the following Visual Basic statements:
Method 3: Use the Select MethodYou can use the Select method of the Selection object to select the current paragraph, as in the following Visual Basic statement:
For additional information about how to move the insertion point within a paragraph, click the article number below to view the article in the Microsoft Knowledge Base:
212696For additional information about getting help with Visual Basic for Applications, click the article numbers below to view the articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/212696/EN-US/ )WD2000: Macros to Move to Beginning and End of Paragraph
(http://support.microsoft.com/kb/212623/EN-US/ )WD2000: Macro Programming Resources
(http://support.microsoft.com/kb/226118/EN-US/ )OFF2000: Programming Resources for Visual Basic for Applications