With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!
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) With oStory.Find .Text = "[LOGO]" .Replacement.Text = "" .Wrap = wdFindContinue .Execute() MsgBox(oApp.selection.text) End With oStory = oStory.NextStoryRange End While End If Next oStory oDoc = Nothing oApp = Nothing End Sub End Class
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.