1. Home
  2. Computing & Technology
  3. Visual Basic

VBA - The Word Working Partner - Part 2

By , About.com Guide

1 of 4

Word Objects

Record New Macro options

Record New Macro options

If you have written Visual Basic 6 programs, but no Word VBA programs, you'll notice a lot of methods and properties you haven't seen before. Every VBA enabled application adds a new set and it's very difficult to remember them for all of the different applications. At the same time, you need to know what they are and how to use them. They're the key to the VBA treasure house. You need help! One of the best ways to get help is by using the Record Macro function described in the first lesson of this tutorial.

In the example on the previous page,

~~~~~~~~~~~~~~~~~~~~~~~~~
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
~~~~~~~~~~~~~~~~~~~~~~~~~

the code is almost entirely composed of obscure Word VBA keywords. When I was writing this tutorial, I learned what they were from a recorded macro.

This is a good place to suggest another tip. When using Record Macro, avoid cluttering up the Normal template with your experimental code (or with your completed code unless you really do want to add your program more or less permanently to Word). Save your code in your own document. Or create a another template and save it there. This is something you just have to force yourself to remember to do since the Normal template is the default in Record Macro (even though it probably shouldn't be).

Explore Visual Basic
By Category
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB 6
  5. Learn VBA
  6. VBA - The Word Working Partner - Part 2

©2009 About.com, a part of The New York Times Company.

All rights reserved.