Document Merge

J

Joe

I've got a customer who has been taking their Word Document transcriptions,
pushing enter four times at the top of the page, then printing them on the
pre-printed letter head in order to fax them out.
Now that they're on a centralized shared faxing system, we need to get the
previous documents merged into a letter head template I've created.
What would be the best way to automate the removal of those <enter> marks at
the top of the pages, while merging the doc onto the template letter head,
and saving with it's current document title in it's current document
location?
There are thousands of documents that need this done (at least five years
worth of daily patient office visit transcriptions).
Would some kind of script or macro be the way?
Can somebody point me in a direction?
Thanks in advance.
Joe
 
D

Doug Robbins

Running a macro with the following (untested) code may do everything for
you.

Dim MyPath As String
Dim MyFileName As String
Dim Source As Document, Target As Document, MyRange As Range

With Dialogs(wdDialogCopyFile)
If .Display() <> -1 Then Exit Sub
MyPath = .Directory
End With
If Len(MyPath) = 0 Then Exit Sub
If Asc(MyPath) = 34 Then
MyPath = Mid$(MyPath, 2, Len(MyPath) - 2)
End If
MyFileName = Dir$(MyPath & "*.doc")
While MyName <> ""
Set Source = Documents.Open(MyPath & myFile)
Set MyRange = Source.Range
MyRange.Start = MyRange.Paragraphs(5).Start
Set Target = Documents.Add("your template")
Target.Range.FormattedText = MyRange.FormattedText
Source.Close wdDoNotSaveChanges
Target.SaveAs "C:\NewFolder\" & myFile
Target.Close
MyName = Dir
Wend

I would start with just a few of the documents in a folder by themselves to
test it, and before running it, create a new folder (C:\NewFolder) for the
"new" documents to be saved into, so that they do not overwrite the
originals.

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

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