MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
Sub RedFlags() Dim sCheckDoc As String Dim docRef As Document Dim docCurrent As Document Dim wrdRef As String Dim wrdPara As Paragraph sCheckDoc = "c:\checklist.doc" Set docCurrent = Selection.Document Set docRef = Documents.Open(sCheckDoc) docCurrent.Activate Options.DefaultHighlightColorIndex = wdRed Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting Selection.Find.Replacement.Highlight = True With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Replacement.Highlight = True .Replacement.Text = "^&" .Forward = True .Format = True .MatchWholeWord = True .MatchCase = False .MatchWildcards = False End With For Each wrdPara In docRef.Paragraphs wrdRef = wrdPara.Range.Text If Asc(Left(wrdRef, 1)) > 32 Then ' remove the paragraph mark: wrdRef = Left(wrdRef, Len(wrdRef) - 1) With Selection.Find .Wrap = wdFindContinue .Text = wrdRef .Execute Replace:=wdReplaceAll End With End If Next wrdPara docRef.Close docCurrent.Activate End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.