View Single Post
 
Old 06-29-2022, 12:12 AM
mark99k's Avatar
mark99k mark99k is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Oct 2012
Location: California USA
Posts: 20
mark99k is on a distinguished road
Default

This'll prompt for, and act on, each occurrence. If you actually do want your response to apply to all occurrences in the paragraph (seems unlikely but that's how I read your question), that'll need some more work.

Code:
Sub SubscriptPara()
    Selection.HomeKey wdStory 
    
    With Selection.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = "[0-9]{1,} "
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchWildcards = True
        Do While .Execute
            If MsgBox("Subscript here?", vbYesNo) = vbYes Then
                With Selection.Range.Font
                    .Bold = True
                    .Color = vbBlack
                    .Superscript = True
                    .Size = 10
                End With
            End If
        Loop

    End With
End Sub
Reply With Quote