![]() |
|
|||||||
|
|
|
Thread Tools | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Well that is interesting. I can't claim to understand why, but use:
Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Word.Range
Dim oRngProcess As Word.Range
Set oRng = Selection.Range
Set oRngProcess = oRng.Duplicate
With oRng.Find
.Text = InputBox("Enter text to find.")
Do
.Execute
If oRng.InRange(oRngProcess) Then
With oRng
If Len(oRng) = 0 Then Exit Do
.Font.ColorIndex = wdRed
.Font.StrikeThrough = True
.Collapse wdCollapseEnd
End With
Else
Exit Do
End If
Loop
End With
End Sub
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Find text, format part of text in italic
|
d4okeefe | Word VBA | 18 | 06-30-2022 11:35 PM |
| Macro to find text in between two characters and then format selected text? | qcom | Word | 5 | 02-19-2015 11:23 PM |
Way to search for a string in text file, pull out everything until another string?
|
omahadivision | Excel Programming | 12 | 11-23-2013 12:10 PM |
Find and replace a string of text
|
errtu | Word | 1 | 01-31-2013 02:09 PM |
Bad view when using Find and Find & Replace - Word places found string on top line
|
paulkaye | Word | 4 | 12-06-2011 11:05 PM |