A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"Printing" selected "reocrds" to a word document



 
 
Thread Tools Display Modes
  #1  
Old May 19th, 2005, 02:58 PM
Al Christoph
external usenet poster
 
Posts: n/a
Default "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  
Old May 19th, 2005, 07:32 PM
Doug Robbins
external usenet poster
 
Posts: n/a
Default

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  
Old May 19th, 2005, 08:00 PM
Al Christoph
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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 11: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


All times are GMT +1. The time now is 01:46 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.