Re: Adding two bookmarks to a cell in a table by Helmut
Helmut
Thu Dec 09 04:07:21 CST 2004
Hi Stephen,
how about this one:
Sub Test984()
Dim oRng As Range
Set oRng = ActiveDocument.Tables(1).Cell(1, 1).Range
Resetsearch
With oRng
.Delete
.Text = "Committee Date"
With .Find
.Text = "Committee"
.Execute
End With
.Bookmarks.Add Name:="Ctte"
.Collapse Direction:=wdCollapseEnd
With .Find
.Text = "Date"
.Execute
End With
.Bookmarks.Add Name:="Date"
End With
End Sub
Sub ResetSearch()
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
End Sub
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000