S
Sheila
Within a paragraph, I need to find text that is tagged by start and end tags, do something with the text, and keep looping for more text until no more found. So the user has the cursor somewhere in the paragraph. I am having problems setting the range object to the current paragraph, it keeps changing. Appreciate any help, I have spent too much time and losing all my hair
'move to beginning of paragrap
Selection.MoveUp unit:=wdParagraph, Count:=
'set range to be current paragrap
Set myRange = Selection.Paragraphs(1).Rang
'using line below from another help email I rea
Set selRange = myRange.Duplicat
'loop to find the start tag within the rang
While selRange.Find.Execute(FindText:=startTag, Forward:=True, Format:=False, Wrap:=wdFindStop
'use selection to find start tag and end tag, select evertyhing in-betwee
Selection.Find.Execute FindText:=startTag, Forward:=True, Format:=Fals
Selection.Exten
Selection.Find.Execute FindText:=endTag, Forward:=True, Format:=Fals
'got the text, do something with it ..
strkey = Selection.Range.Tex
'move cursor,
Selection.MoveRight wdCharacter,
Wen
'move to beginning of paragrap
Selection.MoveUp unit:=wdParagraph, Count:=
'set range to be current paragrap
Set myRange = Selection.Paragraphs(1).Rang
'using line below from another help email I rea
Set selRange = myRange.Duplicat
'loop to find the start tag within the rang
While selRange.Find.Execute(FindText:=startTag, Forward:=True, Format:=False, Wrap:=wdFindStop
'use selection to find start tag and end tag, select evertyhing in-betwee
Selection.Find.Execute FindText:=startTag, Forward:=True, Format:=Fals
Selection.Exten
Selection.Find.Execute FindText:=endTag, Forward:=True, Format:=Fals
'got the text, do something with it ..
strkey = Selection.Range.Tex
'move cursor,
Selection.MoveRight wdCharacter,
Wen