Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

MS Word Macros / Visual Basic Code

To the left I have listed links to my current Word macros. I update the list periodically. Feel free to view and copy any of my macros. Enjoy!
 

Introduction:

If you use MS Word on a daily basis, then you must learn how to write macros. So...
 

Do you use MS Word on a daily basis? ...Yes?       

Do you write macros?

NO???!

 
Then you absolutely must learn. It will change your word-processing life! Your computer will no longer be a tool; it will become your servant! Empower yourself! Do your work in half the time, and impress the heck out of your boss! Or, if you work for yourself, work faster and create more free time.


Part I - What is a macro?
Macros are like "paragraphs" full of instructions you give to MS Word. Once you give MS Word the instructions (such as "change the font of this sentence to Courier"), then MS Word can perform that operation for you over and over in the future at the touch of a button. Macro writing is like a tiny, tiny slice of the computer programming field. But don't let that scare you! If you are already comfortable using MS Word and are familiar with the main features of Word, then nothing stands between you and the process of learning macros. You will indeed learn a computer programming language in order to write macros, but don't be turned away by that phrase! As long as you practice on documents which are backed up, or -- better yet -- practice on "dummy" documents that are entirely disposable, then the only "danger" you are exposed to is the loss of that document or part of the data in the document.

You will not damage your computer by attempting to write MS Word macros.


Part II - Where do macros live?
Macros "hide out" in a little-known area of MS Word called the "Visual Basic Editor." The Visual Basic Editor is something you already have -- it comes included with all versions of MS Word. To find and open the Visual Basic Editor, go to the Tools pull-down menu in word, then choose Macro, then choose Visual Basic Editor. Look for the following icon: icon for Visual Basic Editor. For those who like keyboard shortcuts, Alt + F11 will also work.

Screen Shot - Opening VBE through the Tools menu


Part III - I have opened the Visual Basic Editor... now what?
Once you have opened the Visual Basic Editor, you will see a whole new window or interface that is different from the MS Word interface that you are used to. There are some similarities, though. For instance, you will still see a menu bar at the top, although it contains new headings like "Debug" and "Run" in addition to the typical "File Edit View" which are familiar headings from the standard MS Word menu bar.

The menu bar in Visual Basic Editor:
Image of Menu Bar in VBE

To make use of any of the free macros I make available on my site, perform the following 3 steps:

1. First, choose a macro (obviously). Browse through the following list of macros, clicking the links to view each macro together with its description and use.

Document Compactor
HTML De-Tagger
HTML Clean-Up
Explore Folders
Strip Text Boxes
Spell Checker Demo
Once you have chosen a macro to use, you will need to cut and paste it from my web page. Just highlight the macro and right click to copy. The macro is everything from "Sub" to "End Sub," inclusive. By inclusive I mean that you should copy from just before "Sub" to just after "End Sub," thereby including those three words among the total to be copied. DO NOT include other text from my web site in the cut-and-paste procedure. Do not accidentally copy large bold headings labelling the macro, or any descriptive text below the macro.

2. In the Visual Basic Editor, click "Insert" on the menu bar. Then click "Module" to insert a module. This is roughly equivalent to opening a new document. A fresh new "blank page" should open up when you insert the module. This blank page is precisely where you want to PASTE the macro that you copied. So go ahead... now is the time to paste the macro into the module.

3. Now you are ready to RUN the macro. However, the macro will not be able to perform its job unless you have an appropriate document open in MS Word. So be sure to read the macro's description to determine which documents you may want to apply the macro to. Once you have a document open and the macro has been pasted into the module, then you are entirely ready. Simply click on "Run" on the menu bar, and then click "Run Sub/User Form." Voila!


Part IV - Expand your knowledge
The information that I have included in this introduction is the bare minimum necessary to take advantage of my free macros. But wouldn't you love to customize the macros according to your own needs? With just a few hours of self-guided study, you could easily learn to design and implement your own macros.

I suppose it would be possible to get all of your instruction from the web, but I would truly recommend buying a book. I know, I know, the books on computer topics are another source of intimidation. After all, they weigh a ton, they sometimes cost a ton, and how do you know which one to choose when the titles are apparently in a foreign language? Well, at the end of this paragraph I will list a couple of recommendations, but I would also encourage you to visit a bookstore and go leaf through a few books. Many computer books might surprise you. There are authors out there with great senses of humor, who write fun, amusing, totally accessible texts. Just keep opening up books until you find one written in a style and at a level that you like. Also, don't be too worried if the book is for Word 2000 and you have XP, or if the book is for 2000 and you have Word 98. As long as you are working with Word 97 or later, and as long as the book is for Word 97 or later, you should be able to get at least the basics -- and probably more -- from whichever book you find.

Here are two books that I own and have learned from:

Word 2000 Developer's Handbook by Guy Hart-Davis
Teach Yourself Microsoft Excel Programming in 21 Days from Sams Publishing

Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

Support web pages written to maximize browser compatibility
Click here to learn about web standards Validate your web pages here!
Read this to learn about W3C standards

Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms