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

VBA - The Word Working Partner - Part 1

By Dan Mabbutt, About.com

5 of 7

Improving the Example

This code is a sample application, but there's a lot that could be improved in it. For one thing, the code assumes that there is a default letter document in the root directory. ("C:\DefaultLetter.doc") Keeping the default letter document in the root directory probably isn't a good idea. (I did it that way to keep the file specification short and simple.)

Adding your unique personalization to this program is left as an 'excercise for the reader'.

Another techniques that would improve the program might be to code a different way of starting the program. This program takes advantage of the fact that a macro named AutoExec in the startup folder will start automatically. But this is a holdover from the old WordBasic days (WordBasic is a "true" macro language rather than the increasingly Object Oriented VBA). VBA still supports a number of the old WordBasic commands and this is one of them but security problems may force Microsoft to drop this one.

Explore Visual Basic
By Category
About.com Special Features

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

Easy ways to connect two computers for networking purposes. More >

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

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

All rights reserved.