A
avkokin
Hello.
There is the some text which has one or more of the word "text". I
need to get list of all entries this word with number (or reference)
of page where detected this word. I have code (below), but it type
only last number of page. Where is my wrong? Thank you.
Sub poisk()
Dim a As String
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "text"
.Forward = True
.Wrap = wdFindStop
End With
While Selection.Find.Execute = True
a = Str(Selection.Information(wdActiveEndPageNumber))
Wend
Selection.EndKey Unit:=wdStory
Selection.InsertAfter vbCr
Selection.Collapse wdCollapseEnd
Selection.TypeText a & vbCr
End Sub
There is the some text which has one or more of the word "text". I
need to get list of all entries this word with number (or reference)
of page where detected this word. I have code (below), but it type
only last number of page. Where is my wrong? Thank you.
Sub poisk()
Dim a As String
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "text"
.Forward = True
.Wrap = wdFindStop
End With
While Selection.Find.Execute = True
a = Str(Selection.Information(wdActiveEndPageNumber))
Wend
Selection.EndKey Unit:=wdStory
Selection.InsertAfter vbCr
Selection.Collapse wdCollapseEnd
Selection.TypeText a & vbCr
End Sub