I currently have a print button and Module to run a mail-merge through a query, of the current results on a form.
When this is run, I get 3 documents open, the template, the merged document and another word document saying mail merge errors even though it works fine. At the beginning you also get a pop up box where you have to click options and check system tables. When the code runs, it creates an excel document from the query, for the record which is to be merged. Once this is done, simply double clicking the word document will ask yes or no to whether you want to merge, without all the unnecessary documents and options, as the merge comes from the excel.
I've attempted to modify the code to just create the excel document and then open the word document, however, when VB is opening a word template it opens as object. When this happens it doesn't run the merge.
Is there a way to open a word template through VB where it creates a new document and runs the merge, the same way as if I double clicked the template from the folder?
When this is run, I get 3 documents open, the template, the merged document and another word document saying mail merge errors even though it works fine. At the beginning you also get a pop up box where you have to click options and check system tables. When the code runs, it creates an excel document from the query, for the record which is to be merged. Once this is done, simply double clicking the word document will ask yes or no to whether you want to merge, without all the unnecessary documents and options, as the merge comes from the excel.
I've attempted to modify the code to just create the excel document and then open the word document, however, when VB is opening a word template it opens as object. When this happens it doesn't run the merge.
Is there a way to open a word template through VB where it creates a new document and runs the merge, the same way as if I double clicked the template from the folder?