![]() |
|
#1
|
||||
|
||||
![]() Well, if you wanted the hit highlight - as shown in the dialogue box you posted a screenshot of, you should have said so. And, as per my previous reply, even the macro recorder would give you the code for that. Somewhat more sophisticated: Code:
Sub Demo() Application.ScreenUpdating = False Dim StrFnd As String StrFnd = InputBox("What is the text to highlight?") If Trim(StrFnd) = "" Then Exit Sub With ActiveDocument.Range.Find .ClearFormatting .Format = True .Forward = True .MatchWildcards = False .HitHighlight StrFnd, Options.DefaultHighlightColorIndex End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Which part of my post that I said in it that I need to highlight the results, obviously in the last post I said that (I don't want to highlight it, I just need to select them like I prees the find in main document button), I think that I was very clear although my first language is not English.
|
#3
|
||||
|
||||
![]()
The whole point, of course, is that you did not say clearly in your first post that that's what you wanted to achieve.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Possible to create a user form and populate it with a field from the main document? | NMGMarques | Word | 3 | 02-12-2020 06:08 PM |
![]() |
GWTJR | Word VBA | 3 | 10-15-2017 02:22 PM |
Macro to find a word in first row of table and then perform two macros | hmsrose | Word VBA | 5 | 01-30-2015 12:17 AM |
Can Word highlight the same text in the Reviewing Pane as in the main document? | wordistheword | Word | 4 | 09-09-2013 04:50 AM |
Connecting documents to main document | themangoagent | Word | 1 | 08-07-2009 10:15 AM |