That’s what we do here: Set objOptions = objWord.Options To do that we need to do two things: 1) create an instance of Word’s Options object, and 2) assign the constant wdBrightGreen to the Option object’s DefaultHighlightColorIndex property.
HOW TO REMOVE BACKGROUND HIGHLIGHTING IN WORD 2013 CODE
(Hey, when you start out life watching TV in black-and-white any color looks good, even bright green.) What if you consider bright green to be a bit garish? No problem you can use any of the constants and values shown in the following table:Īfter defining the constant we use these two lines of code to create an instance of the Word.Application object and open a new, blank document: Set objWord = CreateObject("Word.Application")Īs soon as we have a document we’re ready to change the default highlight color. Needless to say, we do that because we want to set the default highlight color to bright green. ObjOptions.DefaultHighlightColorIndex = wdBrightGreenĪs you can see, we start out by defining a constant named wdBrightGreen and assigning it the value 4. Set objWord = CreateObject("Word.Application") So can you change the default highlight color for a Word document? Well, as long as you start that document with a script you can: Const wdBrightGreen = 4 The important thing here – beyond the fact that kids these days have no idea how good they really have it – is the fact that color is important, regardless of whether we’re talking about TVs or Microsoft Word documents. After all, the Scripting Dad has only vague memories of what he had for breakfast this morning, despite the fact that – Mondays through Fridays – he pretty much has the same thing for breakfast every morning. We also should point out that the fact that the Scripting Dad has only vague memories of this TV doesn’t mean that all of this happened hundreds of years ago. It’s one thing to give the Scripting Son a little scare every now and then it’s quite another thing to terrify and traumatize the poor kid. But it was real nonetheless, and just the thought of having to watch everything in black-and-white is enough to give the Scripting Son the heebie-jeebies.Īnd no, the Scripting Dad doesn’t mention the fact that there were no remote controls in those days, either. You know, any time the Scripting Guy who writes this column wants to terrify the Scripting Son, he tells the blood-curdling saga of the first TV the Scripting Dad remembers: a TV that showed everything in black-and-white only! Granted, that was a long time ago, and the Scripting Dad has only vague memories of that TV not too long after he was born his Scripting Parents bought a color TV.
Hey, Scripting Guy! How can I change the default highlight color for a Microsoft Word document?