I would like some advice and assistance with a number of issues I am having with Word VBA, beginning with a problem I am having with table formatting not being fixed. I am working with documents involving large numbers of tables, which are required to have the following characteristics:-


  • Fixed column width
  • Font TNR 12
  • Auto (i.e. zero) spacing before and after paragraphs
  • All borders present
  • Tables not allowed to break across pages


The problem arises when the file is saved, closed and then opened again, as in starting again the following day. The first seems OK – fix the column width, and it stays that way. Font ditto – I have a macro which sorts that out anyway, also in relation to the paragraph formatting. The problem arises with the last. To meet this requirement manually, select table and then Alt-O, P, and then w, x, k. That will deal with the table at that stage, but when I save that file, which can contain dozens of similar tables, and then reopen it, it is very likely that these settings will not have survived. Why this is, I don’t know. However, what I am seeking is a routine that will step through a file, table by table, check that the above criteria are present in each case, and if not, change them so that they are. Although I have had some limited success, I am new to VBA; I have experience with FORTRAN and BASIC, but these are now obsolete.

Can you help? What actually is happening to cause this problem? More significantly, can you help me by suggesting a subroutine that will achieve this? If you are, then I will be able to call it from within another macro, which deals with font, paragraph, spacing, justification and various other issues in normal text documents. Many thanks in advance. Steve