Good morning,
Well, we can do this paragraph by paragraph, but that will take the routine
quite a bit longer than using search/replace. The goal of the following
routine is to get the text into a format that you can convert it to a table
(manually) and then move the columns around (manually) and format the
columns (manually). The following routine does the grunt work by inserting a
single tab after bold text in each paragraph. If there is italic formatting
in the paragraph, then it inserts a table after that text, too. If there is
NOT italic formatting (no category), then it inserts an additional tab
character after the bold text (therefore, two tabs after the bold text in
paragraphs without italic formatting). You have to have two tabs to account
for the missing category text. When the routine is done, you're ready to do
the manual work listed above. CAVEAT: This routine assumes that there is
nothing else, really, in the document other than
phrase - category - translation
If that's true, then we could add code to deal with the stuff I have listed
as manual
Dim oRngBold As Range
Dim oRngItal As Range
Dim oRngReg As Range
Dim oPara As Paragraph
Selection.HomeKey Unit:=wdStory
For Each oPara In ActiveDocument.Paragraphs
oPara.Range.Select
With Selection.Find
.ClearFormatting
.Text = ""
.Font.Bold = True
If .Execute Then
Set oRngBold = Selection.Range
'''after you find bold formatting
'''insert a tab after that range
oRngBold.InsertAfter Text:=vbTab
End If
End With
oPara.Range.Select
With Selection.Find
.ClearFormatting
.Text = ""
.Font.Italic = True
If .Execute Then
Set oRngItal = Selection.Range
Set oRngReg = ActiveDocument.Range(Start:=oRngItal.End,
End:=oPara.Range.End - 1)
'''after you find italic formatting
'''insert a tab after that range
oRngItal.InsertAfter Text:=vbTab
Else
Set oRngReg = ActiveDocument.Range(Start:=oRngBold.End,
End:=oPara.Range.End - 1)
'''if you don't find italic formatting
'''insert a tab after the bold range to account
'''for the missing category text
oRngBold.InsertAfter Text:=vbTab
End If
End With
Next oPara
HTH,
Dave