![]() |
|
|
|
#1
|
|||
|
|||
|
NP,
No the problem is universal. Again it is a result of trying to find something in a range when the range is that something. Here is another demo: Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Word.Range
ActiveDocument.Range.Delete
ActiveDocument.Range.Text = "Test"
Set oRng = ActiveDocument.Words(1)
Debug.Print oRng
With oRng.Find
.Text = "Test"
If .Execute Then
MsgBox "Found"
Else
MsgBox "Not found. Why? Because the thing we are looking for exactly matches the search range." & _
" We can't find ""Test"" IN the search range because ""Test"" IS the search range."
End If
End With
'Now redefine the range.
Set oRng = ActiveDocument.Range '(includes Words(1) and the end of document mark.
Debug.Print oRng
With oRng.Find
.Text = "Test"
If .Execute Then
MsgBox "Found."
End If
End With
End Sub
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Onenote 2013 search is not identifying search terms correctly | Delta223 | OneNote | 0 | 08-12-2014 06:40 AM |
| Search for date and then apply mutliple search criteria in huge dataset | maxtymo | Excel | 2 | 12-01-2013 04:52 AM |
| Looking for Windows Search app with ability to search by content | gopher_everett | Office | 1 | 02-28-2013 09:23 PM |
| Search Function Problem | MageWind | Excel | 2 | 06-29-2011 09:46 AM |
Windows explorer search problem...help!!
|
NewSysAdmin | Windows | 1 | 03-08-2011 05:33 PM |