I want to create a Word 2010 document that contains a DATABASE field code to fetch some query result. I inserted that field code using "Insert / Quick Parts". Since the query generates many lines and columns, it ends up as a table in the document. Fine. That's what I want. Then, I created a VBA macro to prompt the user (on Document.Open) to enter a certain value, and then the macro uses that value to update the DATABASE field code to refresh the query results. I tested it and it works fine. Then I formatted the table generated by the DATABASE field code (column headings a certain color, thick border, blah, blah...), and saved the document. When I reopen the document, an InputBox pops up as expected and asks for a value, the macro updates the SQL query in the Text property of the field code object, the data is fetched, the table is updated, but all formatting is lost, even if I specify the "\* MERGEFORMAT" switch inside the DATABASE field code.
What am I doing wrong?