![]() |
|
#3
|
||||
|
||||
|
You could simplify the meetsomecondition setting or even avoid it completely with the following modifications
Code:
Sub BoldStart()
Dim p As Paragraph, i As Integer
Dim oRng As Range, meetssomecondition As Boolean
For Each p In ActiveDocument.Paragraphs
Set oRng = p.Range
i = InStr(1, oRng.Text, "-")
'meetssomecondition = i > 0
'If meetssomecondition Then
oRng.End = oRng.Start + i - 1
oRng.Font.Bold = True
'End If
Next p
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Find, select, and replace part of text with bold
|
paik1002 | Word VBA | 4 | 12-07-2015 11:24 PM |
| How to parse bold sections of a paragraph? | XmisterIS | Word VBA | 2 | 03-31-2014 02:54 PM |
Set style for part of paragraph
|
meileetan | Word | 7 | 06-07-2013 01:09 AM |
Set paragraph text to bold.
|
Sorcerer13 | Word | 1 | 09-04-2012 11:08 AM |
How to indent only half part of the paragraph 2em
|
Samahu | Word | 2 | 01-17-2011 08:15 AM |