Results 1 to 8 of 8
  1. #1
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Mail Merge Toolbar (2002)

    I have several fairly complex mail merge documents, all based on normal.dot. Everything works great, but I'd like to have the Mail Merge Toolbar automatically show itself whenever one of these documents is loaded. It seems like this might be done via a document template, but since my documents "ain't broke," I don't want to try to fix them unless I'm VERY sure about what I'm doing. Any suggestions?
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail Merge Toolbar (2002)

    Hi Lou:

    Upon further testing, I am mistaken, so I'm deleting the text of the post. As you'll be wondering what happened when you receive an email, I'm not deleting the post.

  3. #3
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Re: Mail Merge Toolbar (2002)

    Thanks for not deleting the post! I'd have been pulling my hair out looking for it.

    FYI, I want the mail merge toolbar to appear when the main document opens.
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Mail Merge Toolbar (2002)

    You could add a procedure that checked every document you open to see whether it is a merge document, and then display or hide the Mail Merge toolbar accordingly. I haven't tested this because I already have a lot of stuff that happens when I open a document, and time does not permit setting up a clean test. But you could try it and see what you think:
    <pre>Sub AutoOpen()
    ' Stored in Normal.dot, this will run whenever a document is opened
    If ActiveDocument.MailMerge.MainDocumentType <> wdNotAMergeDocument Then
    ' This is a merge document, so show the Mail Merge toolbar
    If CommandBars("Mail Merge").Visible = False Then _
    CommandBars("Mail Merge").Visible = True
    Else
    ' This is not a merge document, so hide the Mail Merge toolbar
    If CommandBars("Mail Merge").Visible = True Then _
    CommandBars("Mail Merge").Visible = False
    End If
    End Sub
    </pre>

    P.S. As you may know, tested posted using the Lounge's <code><!t>[pre]<!/t></code> and <code><!t>[/pre]<!/t></code> tags does not behave well when pasted directly into a VBA module. For best results, paste it into a blank Word document first, then select and paste again into your VBA module.

  5. #5
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Re: Mail Merge Toolbar (2002)

    Thanks! I'll try it, but if possible, I would definitely prefer to add my "open sesame" ONLY to certain documents. (I've got a bias toward keeping things very simple when my programs open.)

    Is there any chance that adding a document template to the mail merge document could be the route to get this done?
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail Merge Toolbar (2002)

    Hi Lou:
    You could add Jefferson's code directly to your main documents, rather than to a template. Just open the document, press Alt+F11, & you should be in a module for your document. Then paste the code (after first copying & pasting it to a Word document, & recopying it to get rid of the line breaks, as Jefferson pointed out) into the module.

    However, It's been my experience that if you close a main document with the mail merge toolbar showing, it will be showing when you next open the document. Alternatively, you could put the code in a new template that is just for mail merge & attach it to your main documents. That has the advantage of allowing you to add other code that you may later think of & to change styles or have boilerplate.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Mail Merge Toolbar (2002)

    If you use the same template for your main merge documents, then yes, that would be a logical place to put the code.

  8. #8
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Re: Mail Merge Toolbar (2002)

    That sounds like just the ticket: Make a document template that I attach only to mail merge main documents for which I want the mail merge toolbar to appear automatically when they are opened. (I've got a mail merge toolbar toggle on my default toolbar, so I can get rid of the mail merge toolbar just by clicking it when I'm done with mail merges. This new code just eliminates the need to click it when I OPEN a mail merge main document.)

    I'm assuming that I can add macro code to this other template in the same way I add it to normal.dot.
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

Posting Permissions

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