The Art of Defensive Programming
If you can't understand a program, then you can't debug it. Even with code that you have written yourself, if you come back to it six months or a year later, you may find yourself wondering “Why on earth did I write that? What was it for?” It doesn't take long to forget the details of a program when you aren't working on it any more. Make life easier for yourself, and write programs as clearly as possible. Also, provide such defences as you can against the possibility that VBA might change between versions of Word.
West, Jonathan. Word MVP Site, The (2005). Articles>Word Processing>Programming>Microsoft Word
Useful WordBasic Commands That Have no VBA Equivalent
When Microsoft released Word 97, a new programming language VBA replaced the WordBasic language that had been available in earlier versions of Word. For most things, VBA is a much more powerful and flexible programming language than WordBasic, but there are a few very useful WordBasic commands which have no direct equivalents in VBA. Fortunately, VBA includes the WordBasic object, which gives access to most of the old WordBasic commands.
West, Jonathan. STC Proceedings (2005). Articles>Word Processing>Programming>Microsoft Word
When to Use Parentheses to Enclose Subroutine and Function Arguments
The rules are confusing concerning the use of parentheses to enclose argument lists. I have even seen MS Knowledgebase articles that have got it wrong. The rules are as follows.
West, Jonathan. STC Proceedings (2005). Articles>Word Processing>Programming>Microsoft Word
There are 13 readers currently online: 2 registered users and 11 guests. Register.

![]()
![]()


![]()
![]()
![]()