Home |
Search |
Today's Posts |
#1
|
|||
|
|||
mail merge dialog boxes
Hi,
I have a 2003 Word document that contains Mail Merge fields from an Excel document. I am trying to make 2 buttons in Word. -A button that opens the "Open Data Source" dialog box. (I will let the users browse to where they save the Excel file). -A button that opens the "Mail Merge Recipients" dialog box. (I will let the user choose the recipients). I was able to run a macro to get the code for the third button I need: a button that launchs the "Merge to New Document". Is it also possible to delete those 3 buttons once the New document is created? The New document doesn't need the buttons, only the main mail merge document. Also, I was trying to protect my mail merge document, but when I go to Tools, Protect Document, everything is grayed out. Help! Thanks, |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
mail merge dialog boxes
Why not just display the mailmerge toolbar. It contains those three buttons
among others. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "rutica" wrote in message ... Hi, I have a 2003 Word document that contains Mail Merge fields from an Excel document. I am trying to make 2 buttons in Word. -A button that opens the "Open Data Source" dialog box. (I will let the users browse to where they save the Excel file). -A button that opens the "Mail Merge Recipients" dialog box. (I will let the user choose the recipients). I was able to run a macro to get the code for the third button I need: a button that launchs the "Merge to New Document". Is it also possible to delete those 3 buttons once the New document is created? The New document doesn't need the buttons, only the main mail merge document. Also, I was trying to protect my mail merge document, but when I go to Tools, Protect Document, everything is grayed out. Help! Thanks, -- rutica |
#3
|
|||
|
|||
Thanks for writing.
The Mail Merge toolbar buttons are kind of hard to see and not very obvious. Through trial and error and reading other internet posts, this is what I have for my button 1 (Open Data Source): Private Sub cmdSelectDataSource_Click() 'select data source-step 1 Dim DataDoc As String Dim MergeDoc As Document Set fDialog = Application.FileDialog(msoFileDialogFilePicker) With fDialog .Title = "Select data source and click OK" .InitialFileName = "Rpt- Governance Reporting Projects.xls" .AllowMultiSelect = False .InitialView = msoFileDialogViewList .Filters.Clear .Filters.Add "Excel", "*.xl*", 1 If .Show -1 Then MsgBox "Cancelled By User", , Title Exit Sub End If DataDoc = fDialog.SelectedItems.Item(1) End With ActiveDocument.MailMerge.OpenDataSource Name:=DataDoc, ConfirmConversions:=False, Format:=wdOpenFormatAuto, Connection:="Entire Spreadsheet", SubType:=wdMergeSubTypeWord2000 End Sub This is what I have for button 3 (Merge New Document) Private Sub cmdMergeDocument_Click() 'merge document-step 3 With ActiveDocument.MailMerge .Destination = wdSendToNewDocument .SuppressBlankLines = True Me.cmdSelectDataSource.Enabled = False Me.cmdMergeDocument.Enabled = False With .DataSource .FirstRecord = wdDefaultFirstRecord .LastRecord = wdDefaultLastRecord End With .Execute Pause:=False End With Me.cmdSelectDataSource.Enabled = True Me.cmdMergeDocument.Enabled = True End Sub I don't know how to hide the command buttons, but I disabled them. So I still need help with creating a button to open the Choose Recipients dialog box. Also,I still need help with protecting the form. Thanks! Quote:
|
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mail Merge Mystery Dialog Box | Mailmerge | |||
Automated Mail Merge Displaying unwanted Dialog Boxes | Mailmerge | |||
mail merge dialog box | Microsoft Word Help | |||
removal of sql dialog box during mail merge | Mailmerge | |||
Mail Merge - Empty Microsoft Word Dialog box | Mailmerge |