I receive a report in Word and need to export to an Access database. The
problem is the record format isn't in a delimited format. Each record in
Word has the following format:
fied1 text (tab) field2 text(paragraph)
field3 text (tab) field4 text(paragraph)
field5(paragraph)
paragraph
number
paragraph
Next Record
I would like to create a macro or something so the format for each record is
something like: text, text, text, text, number so I can save as txt and
import into Access.
> I receive a report in Word and need to export to an Access database. The
> problem is the record format isn't in a delimited format. Each record in
[quoted text clipped - 11 lines]
> something like: text, text, text, text, number so I can save as txt and
> import into Access.
The macro could be;
Sub ReformatFields()
Dim rgeDoc As Range
Set rgeDoc = ActiveDocument.Range
With rgeDoc.Find
.Text = "(*)^t(*)^13(*)^t(*)^13(*)^13(*^13)"
.Replacement.Text = "\1,\2,\3,\4,\5,\6"
.Wrap = wdFindStop
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
Application.Browser.Target = wdBrowsePage
End Sub
But you could use the .Text and .Repalcement.Text parameters (from the macro
above) directly in the Find/Replace dialog box, making sure to have checked
the Wild Cards option (After clicking on the "More..." button.)
Peter L - 18 Feb 2008 16:49 GMT
Thank you, I'm going to give this a try.
> > I receive a report in Word and need to export to an Access database. The
> > problem is the record format isn't in a delimited format. Each record in
[quoted text clipped - 35 lines]
> above) directly in the Find/Replace dialog box, making sure to have checked
> the Wild Cards option (After clicking on the "More..." button.)