Consulting

Page 5 of 5 FirstFirst ... 3 4 5
Results 81 to 82 of 82

Thread: Run-time error '5922' - Mail Merge

  1. #81
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,635
    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

  2. #82
    VBAX Regular
    Joined
    Feb 2014
    Location
    Ashford, Surrey, UK
    Posts
    64
    Location
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •