I'm trying to find text inside a textbox in a word document.
I've tried everything, but could not get it to highlight the word that I've searched for.
I want to add a logo where the word [LOGO] is in the document.
The replace all works, but I don't want to replace it, I want to find each word and add a logo picture in it's place.
Private Sub cmd1_Click(sender As Object, e As EventArgs) Handles cmd1.Click
Const wdFindContinue = 1
Const wdMainTextStory = 1
Dim oApp As Object = CreateObject("Word.Application")
Dim oDoc As Object
oApp.visible = True
oDoc = oApp.Documents.open("C:\doc.DOC")
Dim oStory As Object
For Each oStory In oDoc.StoryRanges
If oStory.StoryType <> wdMainTextStory Then
While Not (oStory.NextStoryRange Is Nothing)
.Text = "[LOGO]"
.Replacement.Text = ""
.Wrap = wdFindContinue
oStory = oStory.NextStoryRange
oDoc = Nothing
oApp = Nothing