View Single Post
 
Old 04-06-2015, 09:45 PM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,144
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

It is a bit difficult to determine what is a 'title' without knowing how the document is formatted, but the following should format any of the listed characters (separated by the pipe character) that follows a character formatted as italic.
Code:
Sub Demo()
Const strList As String = ".|,|:|;|?|!"
Dim vChar As Variant
Dim i As Long
Dim oRng As Range
    vChar = Split(strList, "|")
    For i = LBound(vChar) To UBound(vChar)
        Set oRng = ActiveDocument.Range
        With oRng.Find
            Do While .Execute(vChar(i))
                oRng.Start = oRng.Start - 1
                If oRng.Characters(1).Font.Italic = True Then
                    oRng.Font.Italic = True
                End If
                oRng.Collapse 0
            Loop
        End With
    Next i
lbl_Exit:
    Exit Sub
End Sub
__________________
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