Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 06-21-2011, 01:45 AM
macropod's Avatar
macropod macropod is online now Problem searching notes in Word 2007 Windows 7 64bit Problem searching notes in Word 2007 Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,514
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Sickorax,

I don't have Word 2007 installed any more - I'm now using Word 2010. In that app, the window split in draft mode doesn't change. That said, here's some macros that might help with your work. Basically, they allow you to quickly navigate forward or backwards for other occurrences of the currently-selected string. Simply assign NavigateNext and NavigatePrev to the Alt-N and Alt-P key combinations, respectively, and you're in business!
Code:
Sub NavigateNext()
Dim StrFnd As String, bDirection As Boolean
StrFnd = Trim(Selection.Text)
If StrFnd = vbNullString Then
  MsgBox "No Text Selected: Please select a find string!", vbOKOnly, "Navigation Error"
  Exit Sub
End If
If Len(StrFnd) > 256 Then StrFnd = Left(StrFnd, 256)
Selection.Collapse wdCollapseEnd
bDirection = True
Call Navigator(StrFnd, bDirection)
End Sub
 
Sub NavigatePrev()
Dim StrFnd As String, bDirection As Boolean
StrFnd = Trim(Selection.Text)
If StrFnd = vbNullString Then
  MsgBox "No Text Selected: Please select a find string!", vbOKOnly, "Navigation Error"
  Exit Sub
End If
If Len(StrFnd) > 256 Then StrFnd = Left(StrFnd, 256)
Selection.Collapse wdCollapseStart
bDirection = False
Call Navigator(StrFnd, bDirection)
End Sub
 
Sub Navigator(StrFnd As String, bDirection As Boolean)
With Selection.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Replacement.Text = vbNullString
  .Text = StrFnd
  .Forward = bDirection
  .Wrap = wdFindStop
  .Format = False
  .MatchAllWordForms = False
  .MatchSoundsLike = False
  .MatchWildcards = False
  .Execute
  If .Found = False Then
    MsgBox Chr(34) & StrFnd & Chr(34) & " not found", vbExclamation
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem searching notes in Word 2007 Searching for Word Reformatter for Complex Docs jchapman Word 1 05-05-2011 04:50 PM
Business Contact Manager 2010 Searching Problem admsvcs Misc 0 03-05-2011 04:29 PM
Problem searching notes in Word 2007 Searching in Outlook 2007 Contacts appears to be stuck danhogan Outlook 2 09-20-2010 07:55 AM
Rare Notes Layout Problem/Question Pantucci PowerPoint 0 07-13-2010 01:41 PM
Problem searching notes in Word 2007 Word attachment with Lotus Notes MRomanow Word 1 08-20-2009 02:50 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:00 PM.


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