1. Technology

Learn VBA Macro Coding with Word 2007 - A "From the Ground Up" Tutorial

Content Controls, Text Form Fields, etc. in Word 2007

By

This tutorial is focused on programming, but since the example uses 'fill-in text', I should mention that Word 2007 already has some rich features to help you do this. One is called Content Controls. From a programming point of view, you can create XML documents that contain your text and add them by name into the document automatically. For example, an XML document like this ...

<?xml version="1.0"?>
<FormLetter>
   <PublisherName>Doofus</PublisherName>
   <GreatWork>whatever I feel like writing</GreatWork>
</FormLetter>

... can be merged into your document using a VBA program.

In addition, Text Form Fields or Content Controls can be used as fill-in text fields that you can tab to without changing the rest of the document. Text content controls are shown below.

--------
Click Here to display the illustration
Click the Back button on your browser to return
--------

So far, you've covered quite a bit of territory in Visual Basic programming. This introduction is a long way from being comprehensive and complete, but using the ideas here, you should be able to explore on your own and develop new knowledge. Some suggested ways to go about doing that are in the next section:

Where To From Here?

A lot of questions at this point is actually a really good sign. It shows that you're ready to take the next steps toward becoming a programming guru. This section is a guide to what some of those steps might be. A lot of them depend on what your goals are.

First, if you're interested in a pure introduction to programming Visual Basic, you're in luck! About Visual Basic also offers a much more complete tutorial for Visual Basic .NET 2008. There'e absolutely nothing to buy to take the next step because all of the software is downloadable free of charge from Microsoft. Go to:

Visual Basic .NET 2008 Express - A "From the Ground Up" Tutorial

If your interest leans in the direction of programming a web page, you might prefer this tutorial:

Learn ASP.NET 2.0 - A "From the Ground Up" Tutorial

Since this introduction is based on just one of the Microsoft Office applications, one of the most obvious steps is to try out the others that support VBA. You might try Excel or perhaps even PowerPoint. Once you feel comfortable with more than one application, you can use them together to build systems that combine the power of several systems at once.

This tutorial has used the technology of VB6 since VBA is just a specialized version of VB6. This presents one problem to the new programmer: Except for VBA, Microsoft isn't supporting VB6 at all today. So, although VBA is still the best option for the non-developer to access the programming power of Office, if you want to take the next step, move up to VB.NET.

GO FOR IT! Visual Basic just doesn't seem to have any limits on the horizon. It's a programming technology for everybody! May all your code be bug free and may a virus never find your system.

  1. About.com
  2. Technology
  3. Visual Basic

©2014 About.com. All rights reserved.