J
J.J.
Many moons ago, I used Word 2000 for transcription. In
order to make a log of patients, i used the
macro "find/date/tab" that Microsoft had sent me. It
would scan the document, block and copy the top line
(containing the date of service, patient name and date of
birth heading) and paste in a second document. This
would create a listing of all records from the original
document.
I now have Office 2003. This is the macro. I run it and
it will create a second document, that is blank, and then
stop. Can anyone help me so I may use it again?
Thank you!
' FindDateTab Macro
' Macro created 5/31/2004 by J Brunmeier
'
Dim sOriginalDoc As String, sDestinationDoc As String
sOriginalDoc = ActiveDocument.Name
Selection.HomeKey Unit:=wdStory, Extend:=wdMove
With Selection.Find
.ClearFormatting
.Wrap = wdFindContinue
.Forward = True
.Text = "/^#^#^t"
.Execute
Documents.Add
sDestinationDoc = ActiveDocument.Name
Documents(sOriginalDoc).Activate
Do While .Found
ActiveDocument.Bookmarks("\LINE").Select
Selection.Range.Copy
Documents(sDestinationDoc).Activate
Selection.Paste
Selection.Collapse direction:=wdCollapseEnd
Selection.InsertParagraphAfter
Documents(sOriginalDoc).Activate
Selection.Collapse direction:=wdCollapseEnd
With Selection.Find
.ClearFormatting
.Wrap = wdFindStop
.Forward = True
.Text = "/^#^#^t"
.Execute
End With
Loop
End With
Documents(sDestinationDoc).Activate
ActiveDocument.Save
sDestinationDoc = ActiveDocument.Name
Documents(sDestinationDoc).Close
End Sub
order to make a log of patients, i used the
macro "find/date/tab" that Microsoft had sent me. It
would scan the document, block and copy the top line
(containing the date of service, patient name and date of
birth heading) and paste in a second document. This
would create a listing of all records from the original
document.
I now have Office 2003. This is the macro. I run it and
it will create a second document, that is blank, and then
stop. Can anyone help me so I may use it again?
Thank you!
' FindDateTab Macro
' Macro created 5/31/2004 by J Brunmeier
'
Dim sOriginalDoc As String, sDestinationDoc As String
sOriginalDoc = ActiveDocument.Name
Selection.HomeKey Unit:=wdStory, Extend:=wdMove
With Selection.Find
.ClearFormatting
.Wrap = wdFindContinue
.Forward = True
.Text = "/^#^#^t"
.Execute
Documents.Add
sDestinationDoc = ActiveDocument.Name
Documents(sOriginalDoc).Activate
Do While .Found
ActiveDocument.Bookmarks("\LINE").Select
Selection.Range.Copy
Documents(sDestinationDoc).Activate
Selection.Paste
Selection.Collapse direction:=wdCollapseEnd
Selection.InsertParagraphAfter
Documents(sOriginalDoc).Activate
Selection.Collapse direction:=wdCollapseEnd
With Selection.Find
.ClearFormatting
.Wrap = wdFindStop
.Forward = True
.Text = "/^#^#^t"
.Execute
End With
Loop
End With
Documents(sDestinationDoc).Activate
ActiveDocument.Save
sDestinationDoc = ActiveDocument.Name
Documents(sDestinationDoc).Close
End Sub