Find/Date/Tab

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
 
D

Doug Robbins

That code can definitely be improved upon, though if it worked before, it
should work now. Rather than try and fix it up, it would be better if you
gave some more specifics of what is in the original document and what you
want to achieve. email me a typical document if you wish and I will take a
look at it.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
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