![]() |
|
#4
|
||||
|
||||
|
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] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
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 |
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 |
Word attachment with Lotus Notes
|
MRomanow | Word | 1 | 08-20-2009 02:50 PM |