![]() |
|
#1
|
||||
|
||||
![]() Along with Paul's corrections, I would also expect problems with a single line of VBA growing beyond limits. You can reduce the likelihood of that being an issue by simplifying the quote marks and concatenating chunks into separate lines. Code:
Sub FillerWords() ' Highlights filler words Dim i As Long, sList As String, TargetList() As String sList = "admit|all off|as being|as to whether|as yet|care about|go on|grateful every day|if you need to|" sList = sList & "if you want|if you wish|if you would like to|I might add|in terms of|in my opinion|" sList = sList & "in spite of that fact that|in the event of|in the event that|in the process of|it seems like|" sList = sList & "made it to|pick out|pick up on|play up|point out|put off|put together|really|spend|take action to|" sList = sList & "takes up|taking up|talk about|the most important thing is to|the reason|time and again|took up|" sList = sList & "try to figure out|went back over|when it comes to|which is|who is|will be different|you can|" sList = sList & "you're going to|you're going to have|you're going to need to|in general|mostly|sort of|virtually|" sList = sList & "often|I think|absolutely|definitely|very|totally|literally|just|ironically|truly|actually|basically|" sList = sList & "to know|I see|I feel|I hear|I can feel|almost|all of|factor|for all intents and purposes|for the most part|" sList = sList & "for the purpose of|harder than it has to be|individual|initial|on a regular basis|the first step is to|time and time again|with reference to" TargetList = Split(sList, "|") Options.DefaultHighlightColorIndex = wdPink With ActiveDocument.Content.Find .MatchCase = False .MatchWholeWord = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Wrap = wdFindContinue .ClearFormatting .Replacement.ClearFormatting .Replacement.Highlight = True For i = LBound(TargetList) To UBound(TargetList) .Text = TargetList(i) .Execute Replace:=wdReplaceAll Next End With End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia Last edited by Guessed; 03-24-2021 at 09:15 PM. Reason: Fixed spelling mistake 'simplying' |
#2
|
||||
|
||||
![]()
True, but that isn't an issue with the OP's code warranting such an approach.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Le_Blanc | Word VBA | 10 | 03-22-2021 11:38 AM |
Problems with Macro for inserting autotext when autotext name isn't followed by a space | amz1950 | Word VBA | 0 | 02-14-2018 10:20 AM |
Macro problems with Word for Mac 2016 16.9.1 | JML | Word VBA | 2 | 02-03-2018 01:14 PM |
Spell check macro within macro button field doesn't work in one document | samuelle | Word VBA | 0 | 07-20-2016 02:27 AM |
Cutting and Pasting and Macro problems in Excel 2010 | enkel | Excel Programming | 3 | 01-02-2012 10:15 PM |