No matter how many features Microsoft builds into Word, there are going to be things that you will want to do over and over in lots of documents. There may also be functions in other documents, like part of an Excel spreadsheet, that you want to use in your Word document. And ... Microsoft may have simply left out a feature that you want to have available in your "personalized" version of Word.
To introduce you to Microsoft Word VBA programming, we're first going to code a very short program that is sort of a "bootstrap" for learning to program VBA. After that's done, we'll create a few more short VBA programs to illustrate components, and provide additional code samples. The completed document with all of the VBA programs is avalilable for download here.
We're going to create a program that starts automatically and displays the path to the Word "startup folder". In order to do this, we're going to have to find out what the startup folder is. Before you say, "Hey! You can just go to Tools > Options > File Locations tab and see what the startup folder is. You can also use the C:\Program Files\Microsoft Office\Office\Startup folder." I know that. We're doing it this way to learn how to code Word VBA programs.
First, start Word and then go to Tools > Macro > Visual Basic Editor. Click the Module option under the Insert menu. Enter this code. (Note that long lines are continued in most examples here. You can enter these lines without the continuation if you want to.)
Public Sub AutoExec()
MsgBox ("The Word Startup Folder is: " _
& vbCrLf & Word.Application.StartupPath)
End Sub