View Single Post
 
Old 11-17-2020, 05:59 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,421
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Here is one way:
Code:
Sub StyleCheck_ContractionsTest()
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  Selection.HomeKey Unit:=wdStory
  With oRng.Find
    .Text = "can't"
    .MatchCase = False
    .Wrap = wdFindStop
     While .Execute
       oRng.Select
       If MsgBox("Do you want to amend the selected contraction?", vbYesNo, "Conver") = vbYes Then
         If oRng.Characters.First = "C" Then
           oRng.Text = "Cannot"
         Else
           oRng.Text = "cannot"
         End If
         oRng.Collapse wdCollapseEnd
       End If
     Wend
  End With
  MsgBox ("Complete!")
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote