Dear vba coders,
I'm working on a large word2010 document for my company. Because in the document there are a lot of cross references that I want to check before printing them. Due to the fact that other users work with this document as well I want to make sure that all cross references are valid.
I am only thinking of a simple string search and if this string has been found in the document a message box should open
I searched already the internet and tried to program my own code, but it didn't work out sadly...
This code I found in the internet but it doesn't work somehow in Word2010 (I marked them red)
Sub Fehlersuche()
Dim strFind As String = "find me"
With ThisApplication.Selection.Find
.ClearFormatting()
.Text = strFind
If .Execute = True Then
MessageBox.Show ("Text found.")
Else
MessageBox.Show ("The text could not be located.")
End If
End With
End Sub
I'm a VBA noobie and appreciate your help very much
Thomas