With CreateObject("Q:\Index\Documents\FlatStation Quotation.dotm") .Application.visible=True .MailMerge.Execute .application.activeworkbook.saveas2 "G:\OF\invoices " & format(date,"yyymmdd") & ".docx" .Close 0 End With
With CreateObject("Q:\Index\Documents\FlatStation Quotation.dotm") .Application.visible=True .MailMerge.Execute .application.activeworkbook.saveas2 "G:\OF\invoices " & format(date,"yyymmdd") & ".docx" .Close 0 End With
snb, thanks a lot for that bit of code. As I understand it, though, that would mean that you have to save it first? I thought you might be able to determine the name before you save the document. Thinking about it now, I guess that it's unlikely to work, but normally with documents, if you save a template it uses the template's name. Is this possible? It could even be that the dialogue box asking for save location immediately pops up.
I love your solution, but I'm finding it a tad unreliable and wonder if you have any suggestions. Still, despite the application.visible command, the dialogue box doesn't come to the front. I often have to alt+tab to get to it. This is absolutely fine for me, but other users are so competent/aware. Also, for the first time I run the macro each day, the dialogue box comes up, but then word doesn't come up. very weird!
I really appreciate your help, sir. It's been genuinely excellent for me to have your help.