Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Creating a macro to run a merge and then printing , then save
I would like to create a macro that would
1.) prompt you for the record numbers from the data source (excel), run the merge 2.) prompt if you want to print, if you do, select the default printer and then print 3.) prompt if you want to email a copy of the document, if so, ask for receivers name(s) and send the doc 4.) and then save the file in a given directory with a file name for a combination of three fields 5.) then close the document. Can any body help me with this or point me to a site(s) that could show me how? Eventually I would like to have another macro that would do the same as this macro, except step one that would ask you for a list of criteia and then filter the excel file to those rows and then merge with that info. The purpose of this document is to create invoices Thanks, Bruce |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Creating a macro to run a merge and then printing , then save
With so much prompting, I doubt that a macro would be of much benefit over
just using the facilities available via the mailmerge toolbar with the exception perhaps of the saving the document(s) with names derived from the data source. For that see the "Individual Merge Letters" item on fellow MVP Graham Mayor's website at: http://www.gmayor.com/individual_merge_letters.htm If you are using Word XP or later, the "Add-in to Merge Letters to Separate Files" that I have written and that can be downloaded from that site will allow you to create each letter as a separate file with a filename taken from a field in the data source with a minimum of fuss. If you really want to try and automate the whole process, you are going to need to get right up to speed on the creation of userforms in Word. To get started on that, see the article "How to create a Userform" at: http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm I would suggest that you will need two list boxes on the userform, one of which is populated with the records from your data source by the initialize event of the user form and the other one is used as a repositry for the records that you select from the first list box by double clicking on the ones that you want to include in the merge. You would need the facility to remove a record from the second list box in case it was added by mistake. You would also a checkboxes on the form that would be used to indicate if letters were to be emailed and a command button that would execute the merging (not necessarily by the use of mailmerge) of the data from each record into the letters that you want to create. Not really a job for a beginner, but a worthwhile project to get started on if you really want to learn. -- 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 "Bruce" oleexpres.at.johnsonclan.net wrote in message ... I would like to create a macro that would 1.) prompt you for the record numbers from the data source (excel), run the merge 2.) prompt if you want to print, if you do, select the default printer and then print 3.) prompt if you want to email a copy of the document, if so, ask for receivers name(s) and send the doc 4.) and then save the file in a given directory with a file name for a combination of three fields 5.) then close the document. Can any body help me with this or point me to a site(s) that could show me how? Eventually I would like to have another macro that would do the same as this macro, except step one that would ask you for a list of criteia and then filter the excel file to those rows and then merge with that info. The purpose of this document is to create invoices Thanks, Bruce |