N
Newfy-Lover
How do you move the Insertion Point using the Find method?
This code does not move the Insertion Point to where the find is.
Dim wdApp As New Word.Application
Dim doc As Word.Document
Dim WholeDocumentRange As Word.Range
doc = wdApp.Documents.Open(OutputFolder & "\" & FileName)
WholeDocumentRange = wdApp.ActiveDocument.Content
WholeDocumentRange.Find.ClearFormatting()
With WholeDocumentRange.Find
.Text = "Defect #" .Forward = True
.Wrap =
Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
WholeDocumentRange.Find.Execute()
<insert text here and it appears at the beginning of the
document and not at the Find location. The Find text is in the document.>
Thanks for your help.
Scott
This code does not move the Insertion Point to where the find is.
Dim wdApp As New Word.Application
Dim doc As Word.Document
Dim WholeDocumentRange As Word.Range
doc = wdApp.Documents.Open(OutputFolder & "\" & FileName)
WholeDocumentRange = wdApp.ActiveDocument.Content
WholeDocumentRange.Find.ClearFormatting()
With WholeDocumentRange.Find
.Text = "Defect #" .Forward = True
.Wrap =
Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
WholeDocumentRange.Find.Execute()
<insert text here and it appears at the beginning of the
document and not at the Find location. The Find text is in the document.>
Thanks for your help.
Scott