Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]() 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 |
#2
![]() |
|||
|
|||
![]()
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 "Joe" . wrote in message ... 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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Word Compare and Merge Document Function | Microsoft Word Help | |||
How to protect the main document in a mail merge process | Mailmerge | |||
merge data into graph in main merge document | Mailmerge | |||
How do I merge an excel document | Tables | |||
How do I mail merge when only merge document is shown in tools? | Microsoft Word Help |