View Single Post
 
Old 12-20-2021, 04:40 AM
effimera effimera is offline Windows 10 Office 2019
Novice
 
Join Date: Jun 2021
Posts: 8
effimera is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
Without the document to test, the following should work

Code:
Sub Macro1()
Dim oRng As Range
Dim oPara As Range, oNewPara As Range
Dim i As Long
    Set oRng = Selection.Range
    If oRng.End = ActiveDocument.Range.End Then
        oRng.InsertParagraphAfter
    End If
    For i = oRng.Paragraphs.Count To 1 Step -1
        Set oPara = oRng.Paragraphs(i).Range
        Set oNewPara = oPara.Duplicate
        oNewPara.Collapse 0
        oNewPara.FormattedText = oPara.FormattedText
        oNewPara.Font.Italic = True
    Next i
lbl_Exit:
    Set oRng = Nothing
    Set oPara = Nothing
    Set oNewPara = Nothing
    Exit Sub
End Sub

Thank you, gmayor!
It works perfectly - much obliged
Reply With Quote