View Single Post
 
Old 10-07-2016, 04:06 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Based on your other post in this forum
Code:
Dim p As Paragraph
Dim oRng As Range
Dim Thistext As String
Dim meetssomecondition As Boolean

    For Each p In ActiveDocument.Paragraphs
        meetssomecondition = False
        Thistext = p.Range.Text
        If InStr(1, Thistext, "-") > 0 Then meetssomecondition = True
        If meetssomecondition = True Then
            Set oRng = p.Range    'set a range to the paragraph
            oRng.Collapse 1    'collapse the range to its start
            oRng.MoveEndUntil "-"    'move the end of the range to the hyphen
            oRng.Font.Bold = True    'format the range
        End If
    Next p
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote