K
Karen
ARRGGH!
I have a cell with text that wraps to a second line (the second line is also
indented). It look likes
Description1: This is the fourth picture in a series
of eighteen pictures which were taken
I am trying to select all of the text that follows 'Description:^t', so my
code looks like
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Description:^t"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=1
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="Caption" & i
.DefaultSorting = wdSortByName
.ShowHidden = True
End With
Selection.EscapeKey
The only problem is that the
Selection.Extend
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
part just goes to the end of the first line, not to the end of the text in
the cell. There is no paragraph mark at the end of the first line, it just
wraps to the second indented line.
How can I select all of the text following 'Description:^t' ?
I have a cell with text that wraps to a second line (the second line is also
indented). It look likes
Description1: This is the fourth picture in a series
of eighteen pictures which were taken
I am trying to select all of the text that follows 'Description:^t', so my
code looks like
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Description:^t"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=1
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="Caption" & i
.DefaultSorting = wdSortByName
.ShowHidden = True
End With
Selection.EscapeKey
The only problem is that the
Selection.Extend
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
part just goes to the end of the first line, not to the end of the text in
the cell. There is no paragraph mark at the end of the first line, it just
wraps to the second indented line.
How can I select all of the text following 'Description:^t' ?