If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
"Printing" selected "reocrds" to a word document
I have a data base that contains all the information need to produce church
bulletins for the coming year. I have a word template that nicely merges everything together. However, this is not the final product for the pews. Others are involved. I need to send in the merged document, and they have requested that it come as an MS Word document. 1. How do "print" to a Word document? If I just cut and paste, the field associations remain. 2. Is there a command to output a range of records? Right now it only does the currently displayed record. I'm not sure that this is exactly on topic since its not a mail merge situation, but rather some other kind of use the data from Access in a Word document mess. (Working Sunday by Sunday and printing the bulletins myself this made sense and worked, but I'm not longer in the final production game.) Regards, Al |
#2
|
|||
|
|||
If the template is a mailmerge main document, execute the merge to a new
document. If you want to split that document into separate files, one for each record in the data base, you can use either of the following methods: ' Macro created by Doug Robbins to save each letter created by a mailmerge as a separate file. Dim i As Long, Source as Document, Target as Document, Letter as Range Set Source = ActiveDocument For i = 1 to Source.Sections.Count Set Letter = Source.Sections(i).Range Letter.End=Letter.End-1 Set Target = Documents.Add Target.Range=Letter Target.SaveAs FileName:="Letter" & i Target.Close Next i If you want each file to be named based on one of the fields in the data source, here's a method that I have used that involves creating a separate catalog type mailmerge maindocument which creates a word document containing a table in each row of which would be your data from the database that you want to use as the filename. You first execute that mailmerge, then save that file and close it. Then execute the mailmerge that you want to create the separate files from and with the result of that on the screen, run a macro containing the following code and when the File open dialog appears, select the file containing the table created by the first mailmerge ' Throw Away Macro created by Doug Robbins ' Dim Source As Document, oblist As Document, DocName As Range, DocumentName As String Dim i As Long, doctext As Range, target As Document Set Source = ActiveDocument With Dialogs(wdDialogFileOpen) .Show End With Set oblist = ActiveDocument Counter = 1 For i = 1 To oblist.Tables(1).Rows.Count Set DocName = oblist.Tables(1).Cell(i, 1).Range DocName.End = DocName.End - 1 'Change the path in the following command to suit where you want to save the documents. DocumentName = "I:\WorkArea\Documentum\" & DocName.Text Set doctext = Source.Sections(i).Range doctext.End = doctext.End - 1 Set target = Documents.Add target.Range.FormattedText = doctext target.SaveAs FileName:=DocumentName target.Close Next i -- 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 "Al Christoph" wrote in message ... I have a data base that contains all the information need to produce church bulletins for the coming year. I have a word template that nicely merges everything together. However, this is not the final product for the pews. Others are involved. I need to send in the merged document, and they have requested that it come as an MS Word document. 1. How do "print" to a Word document? If I just cut and paste, the field associations remain. 2. Is there a command to output a range of records? Right now it only does the currently displayed record. I'm not sure that this is exactly on topic since its not a mail merge situation, but rather some other kind of use the data from Access in a Word document mess. (Working Sunday by Sunday and printing the bulletins myself this made sense and worked, but I'm not longer in the final production game.) Regards, Al |
#3
|
|||
|
|||
Thanks,
You got me digging and i found exactly what I by running the wizard. Don't think I've ever done it in the current releases. Regards, Al "Doug Robbins" wrote in message ... If the template is a mailmerge main document, execute the merge to a new document. If you want to split that document into separate files, one for each record in the data base, you can use either of the following methods: ' Macro created by Doug Robbins to save each letter created by a mailmerge as a separate file. Dim i As Long, Source as Document, Target as Document, Letter as Range Set Source = ActiveDocument For i = 1 to Source.Sections.Count Set Letter = Source.Sections(i).Range Letter.End=Letter.End-1 Set Target = Documents.Add Target.Range=Letter Target.SaveAs FileName:="Letter" & i Target.Close Next i If you want each file to be named based on one of the fields in the data source, here's a method that I have used that involves creating a separate catalog type mailmerge maindocument which creates a word document containing a table in each row of which would be your data from the database that you want to use as the filename. You first execute that mailmerge, then save that file and close it. Then execute the mailmerge that you want to create the separate files from and with the result of that on the screen, run a macro containing the following code and when the File open dialog appears, select the file containing the table created by the first mailmerge ' Throw Away Macro created by Doug Robbins ' Dim Source As Document, oblist As Document, DocName As Range, DocumentName As String Dim i As Long, doctext As Range, target As Document Set Source = ActiveDocument With Dialogs(wdDialogFileOpen) .Show End With Set oblist = ActiveDocument Counter = 1 For i = 1 To oblist.Tables(1).Rows.Count Set DocName = oblist.Tables(1).Cell(i, 1).Range DocName.End = DocName.End - 1 'Change the path in the following command to suit where you want to save the documents. DocumentName = "I:\WorkArea\Documentum\" & DocName.Text Set doctext = Source.Sections(i).Range doctext.End = doctext.End - 1 Set target = Documents.Add target.Range.FormattedText = doctext target.SaveAs FileName:=DocumentName target.Close Next i -- 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 "Al Christoph" wrote in message ... I have a data base that contains all the information need to produce church bulletins for the coming year. I have a word template that nicely merges everything together. However, this is not the final product for the pews. Others are involved. I need to send in the merged document, and they have requested that it come as an MS Word document. 1. How do "print" to a Word document? If I just cut and paste, the field associations remain. 2. Is there a command to output a range of records? Right now it only does the currently displayed record. I'm not sure that this is exactly on topic since its not a mail merge situation, but rather some other kind of use the data from Access in a Word document mess. (Working Sunday by Sunday and printing the bulletins myself this made sense and worked, but I'm not longer in the final production game.) Regards, Al |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The WordPerfect "Reveal Codes" method is so much easier to use. | Torden | General Discussion | 6 | April 19th, 2010 07:50 PM |
is word perfect compatible with office word? | Noreen | General Discussion | 1 | May 11th, 2005 11:17 PM |
Converted document from WordPerfect. New footnotes are not being. | C Lowman | General Discussion | 1 | January 26th, 2005 10:19 PM |
How to run word and pass a mail merge values and fax it to the recipient | Belinda | Mailmerge | 2 | June 13th, 2004 12:49 AM |
word error | mac | General Discussions | 1 | May 6th, 2004 08:14 AM |