![]() |
#5
|
|||
|
|||
![]()
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 |
Tags |
vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
wardw | Word | 2 | 09-25-2019 09:19 AM |
This is not a valid selection | edenworkshops | Word | 3 | 09-18-2019 05:43 AM |
![]() |
NobodysPerfect | Word VBA | 3 | 01-14-2015 12:58 PM |
![]() |
ramsgarla | Word VBA | 9 | 12-05-2012 03:23 AM |
How do you add to a selection list? | bryanarn | Excel | 2 | 03-05-2012 05:04 PM |