The Book’s Sample Code
When reading this book, you will encounter many small programming examples to illustrate the concepts. I use small coding examples, if possible, to illustrate a point.
Personally, I seem to learn much more quickly and easily by tinkering with and tracing through short program segments than by studying a long, detailed example that has a lot of irrelevant stuff in it, as many do. Also, the difficulty in tinkering with a long program is that changing a few lines can affect other portions of the code to the point where the program will no longer run. Then you have to waste time trying to figure out why it won’t run.
On the other hand, if, for example, I want to figure out exactly what Word VBA thinks is a word (you might be surprised), I write a short program of perhaps a half-dozen lines with which to experiment. This is a great way to learn, is often much quicker than hunting through online documentation (which may very well not have the answer anyway), and also shows off the advantages of an interpreted language (a language that is easily traced one line at a time). [1]
I encourage you to follow along with the code examples by typing them yourself. (Nevertheless, if you’d rather save yourself the typing, sample programs are available online; see “Obtaining the Sample Programs” later in this preface.) Also, I encourage you to experiment; it is definitely the best way to learn.
However, I must add a small caveat. Word programming is very powerful. To protect yourself, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access