Mail Merge Toolbar

D

Dave C

I have added an button to the mail merge toolbar that runs a macro. When I
merge to a document the native button on the tool bar become inactive but the
'custom' button does not. Is there a way I can disable the custom button so
it is not available on the merged document?

Thanks for any help.

Dave
 
G

Graham Mayor

A custom button saved in a template will be available to the template and
documents created from it. If you want the macro it calls to only run in a
merge source document then add a line or two to the start of the macro

If ActiveDocument.MailMerge.MainDocumentType = wdNotAMergeDocument Then
MsgBox "This function is for mail merge source documents only",
vbExclamation, "Not a merge document"
Exit Sub
End If

The MsgBox line is optional.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top