View Single Post
 
Old 06-16-2025, 08:45 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,161
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The code looks as compact as you could possibly make it but there could be improvements made.

First, the MsgBox question will recolour the entire document range if you ever choose yes because oRng wasn't redefined to limit itself to just the selection. You probably meant to use the selection {or ActiveDocument.Range(varParts(0), varParts(1))} instead of oRng in this line
oRng.Font.TextColor = wdColorBlack
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote