Saturday, November 27, 2010

How to use Visual Basic in Word ...

id = 'IntelliTXT "> <p know how Microsoft Visual Basic for Applications (VBA) can use in Microsoft Word can be very useful. ... .Word is a word processing program in Microsoft Office suite. ... .VBA is often used to automate routine tasks in Word and other Microsoft Office applications. ... .A good time would be to use VBA in Word when you add to 500 tables in a document, and add domain names is ever needed. ... .What follows is a small example of how to use VBA in Word, but you can use VBA to automate other repetitive tasks </ p> difficulty. .. <h2 Moderately easy class="Heading1a Underline header"> instructions <id = ol. .<li> "IntelliTXT" id = "jsArticleStep1"> 1 <p> Open click Microsoft Office Word 2007. "Developer" and select "Visual Basic ..", select the menu " .; Insert "and select" Modules ". .. </ P> <li id="jsArticleStep2"> <p> 2 Type the following command to create a new subroutine: Private Sub useVBinWord () Press the Enter key. .. </ P> <li Id="jsArticleStep3"> <p> 3 Enter the following command to two lines of text: Selection.TypeText Text: = "I'm inserting this text them. .Word Document Selection.TypeParagraphSelection.TypeText Text: =. ". .I also want to insert the table: "Selection.TypeParagraph </ p> <li id="jsArticleStep4"> 4 <p> Enter the following to insert a table with four columns and four rows.. .ActiveDocument.Tables.Add Range: = Selection.Range, numRows = 4, numColumns: = _ 4, DefaultTableBehavior: wdWord9TableBehavior = AutoFitBehavior: _ = wdAutoFitFixed selection with. .. Tables (1) if Style <> "Table Grid style =.. .Then .. ."Table Grid" End If. .. ApplyStyleHeadingRows = True. .. ApplyStyleLastRow = False. .. ApplyStyleFirstColumn = True. .. ApplyStyleLastColumn = False. .. ApplyStyleRowBands = True. .. ApplyStyleColumnBands = False End With </ p> Add <li id="jsArticleStep5"> <p> type 5 Below to domain name table columns. .Selection.TypeText Text: = Field1 Selection.MoveRight Unit. WdCellSelection.TypeText = Text: = "field2" Selection.MoveRight Unit: = wdCellSelection.TypeText Text: = "Field3" Select .. .. MoveRight Unit: = wdCellSelection.TypeText Text: = "Field4" press "F5" to your subroutine </ p> ....

No comments:

Post a Comment