![]() |
|
#4
|
|||
|
|||
|
Hi Greg
Leading on from this, I am making another version that searches for contractions. However, how can I make it search without matchcase, but replace WITH matchcase? e.g. if it finds "Can't" I want it to replace it with Cannot, not cannot. 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 oRng.Text = "cannot" oRng.Collapse wdCollapseEnd End If Wend End With MsgBox ("Complete!") lbl_Exit: Exit Sub End Sub |
| Tags |
| vba |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Is there a way to go to the next selection?
|
wardw | Word | 2 | 09-25-2019 09:19 AM |
| This is not a valid selection | edenworkshops | Word | 3 | 09-18-2019 05:43 AM |
Selection.Bookmarks("\headinglevel") WITHOUT Selection
|
NobodysPerfect | Word VBA | 3 | 01-14-2015 12:58 PM |
Selection of all Text for a specific page in word is spanning selection across pages
|
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 |