Wednesday 10 October 2018

Word Macros for equations

I have been copying and pasting tables and equations in MS-Word for far too long. At last I have written some word macros to speed things up, so I can more easily produce correctly aligned equations like
Fig 1: Aligning equation numbers neatly using 2 x 1 tables
Fig: LHS of equations unchanged and aligning equation numbers
I also wrote macros to create left / centre / right justified equations using font size 12 instead of 10 which MS always uses and I find too small.

So I now have a "Quick access toolbar" like this

After the AB icon, they have the following effects
  1. Select table
  2. Add bars on table
  3. Remove bars from table
  4. Make table a box. 
  5. Insert left justified equation (font size 12)
  6. Insert unbarred 2 x 1 table with centred justified equation in column 1, (xx) in column 2 (Fig 1)
  7. Insert unbarred 3 x 1 with right justified equation in column 1, (xx) in column 3 (Fig 2)
The first four are very useful for quickly sorting problems with tables and tidying them. They are all linked directly to MS-Word commands. 5-7 are linked to the macros. Sadly the equation insertion macros cannot be used twice the table creation macros! Therefore we also need icon 5, π, to manually insert the equation in the middle column of the three column table.

The macros are in WordBasic not VBA which is a bit amateurish, but WordBasic is what the Word macro recorder writes.

If you would like to use these macros click Read more and copy and paste them into the Word Visual Basic editor on the Developer tab.

The version in Read more might be out of date. I am fairly diligent about keeping back up versions here.