It sounds like the issue is not necessarily with your macro. If the macro finishes and the table is formatted the way you wanted it - and it persists while the document is open then it sounds OK.
If the problem then appears only after Close/Open then you may have other macros that are running which 'standardise' the tables. Can you have a look at your templates and verify that there aren't automacros which might be causing your table local formatting to change?
I would also question what you mean by losing the heading format. Your macro is applying a table .Rows.HeadingFormat as well as local font.bold and paragraphformat.alignment settings. Are all three of these settings disappearing? Would applying a paragraph style persist better for the last two?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
|