View Single Post
 
Old 01-12-2018, 01:56 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

That should be fairly simple e.g. with the cursor in the first of the two paragraphs run the following
Code:
Sub Macro1()
'Graham Mayor - http://www.gmayor.com - Last updated - 12 Jan 2018
Dim oRng As Range
Dim strEndWord() As Variant
Dim i As Long
    strEndWord = Array("so", "jas", "mf")
    Set oRng = Selection.Paragraphs(1).Range
    If oRng.Start = ActiveDocument.Paragraphs.Last.Range.Start Then
        MsgBox "You cannot process the last paragraph!"
        GoTo lbl_Exit
    End If
    With oRng
        .Font.Bold = True
        .End = .Words(1).End - 1
        .InsertAfter ChrW(9658)
        .End = .End + 1
        .Font.ColorIndex = wdRed
        .End = .Paragraphs(1).Range.End
        .End = .Next.Paragraphs(1).Range.End - 1
        .Start = .Words.Last.Start
        For i = 0 To UBound(strEndWord)
            If strEndWord(i) = LCase(.Text) Then
                .InsertBefore vbTab
                .Font.Bold = True
                Exit For
            End If
        Next i
    End With
lbl_Exit:
    Set oRng = Nothing
    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