![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#7
|
||||
|
||||
|
I'm not sure I understand what your requirements are but this might be what you are looking to do
Code:
Sub ScratchMacro()
'Modifications to Word macro originally coded by Greg Maxey
Dim oRng As Range, oRngE As Range, oRngF As Range, sFind As String
sFind = "That Guy's Cats"
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "Research Refs"
.Font.Bold = True
While .Execute
Set oRngE = oRng.Duplicate
oRngE.End = ActiveDocument.Range.End
With oRngE.Find
.Text = "§"
.Font.Bold = True
If .Execute Then
oRngE.Start = oRng.Start
Set oRngF = oRngE.Duplicate
With oRngF.Find
.Text = sFind
.ClearFormatting
If .Execute Then
oRngE.Start = oRng.Start
oRngE.End = oRngF.End
'oRngE.Select
End If
End With
oRngE.Delete
End If
End With
oRng.Collapse wdCollapseEnd
Wend
End With
lbl_Exit:
Exit Sub
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
| Tags |
| word vba macro |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
bold (or unbold) section of text instead of bold toggling
|
Burt | Word | 6 | 04-06-2019 09:09 AM |
Macro to delete text from cells with specific format
|
Soenke | Word VBA | 4 | 09-01-2016 08:55 AM |
| Bold each line of text that starts with a recurring symbol | qubie | Word | 6 | 08-26-2016 07:10 AM |
Text in #1 is made bold, rest of the document is edited, text in #1 is now not bold
|
footer-assistance | Word | 1 | 06-29-2015 03:49 AM |
| Format Bold in one line makes all lines bold | Nitte | Word | 2 | 02-07-2013 12:34 AM |