View Single Post
 
Old 08-14-2017, 06:57 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
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

Perhaps like

Code:
Sub Macro2()
'Graham Mayor - http://www.gmayor.com - Last updated - 14 Aug 2017
Dim oPara As Paragraph
Dim oRng As Range
    For Each oPara In ActiveDocument.Paragraphs
        'set a range to the paragraph
        Set oRng = oPara.Range
        'remove the paragraph break from the end of the range
        oRng.End = oRng.End - 1
        'Clear any spaces from the end of the range
        Do While oRng.Characters.Last = Chr(32)
            oRng.End = oRng.End - 1
        Loop
        'see if the last word is '[transcript'
        If LCase(Trim(oRng.Words.Last)) = "transcript" Then
            'and if it is delete the paragraph
            oPara.Range.Delete
        End If
    Next oPara
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