Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 10-02-2014, 06:55 AM
gmaxey gmaxey is offline Search in Range Only Problem Windows 7 32bit Search in Range Only Problem Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,636
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

The behavior is discussed here:
http://gregmaxey.com/word_tip_pages/..._property.html

Basically:
1) we can't find a "thing" when that thing exactly matches the search range, and 2) when that thing does exactly match the search range, the dynamically redefined range is a "runaway" range.

I've modified the PracticalIV code on the page to address your specific issue:

Code:
Sub PracticalIV()
Dim oRng As Word.Range
  'Insert a temporary range modifier.
  Selection.Range.InsertAfter "~"
  Selection.MoveEnd wdCharacter, 1
  Set oRng = Selection.Range
  'Add unique (unanticipated formatting to the modifier).
  oRng.Characters.Last.Font.Bold = False
  With oRng.Find
    .Font.Bold = True
    .Replacement.Text = "<start>^&<end>"
    .Execute Replace:=wdReplaceAll
  End With
  'Delete the modifier.
  oRng.Characters.Last.Delete
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



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
Search in Range Only Problem Windows explorer search problem...help!! NewSysAdmin Windows 1 03-08-2011 05:33 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft