PDA

View Full Version : Macro to toggle Blue background white text mode



xluser2007
06-11-2008, 10:10 PM
Hi All,

This is the first time I've posted on the Word forum here.

Basically what I would like to do is create a toolbar button in my personal word to toggle Blue background white text mode.

By this mode, in mean the option from the Tools>Options>General (tab), please see here (http://wordtips.vitalnews.com/FigFiles/T55F1.html) for a picture.

If this is in-built into the customised menu setting could some please indicate how to get it, otherwise how does one do this via VBA (recording a macro didn't quite help).

Thanks and regards for any help.

Oorang
06-12-2008, 06:11 AM
Public Sub ToggleBackGround()
Word.Options.BlueScreen = Not Word.Options.BlueScreen
End Sub

xluser2007
06-12-2008, 06:22 AM
Public Sub ToggleBackGround()
Word.Options.BlueScreen = Not Word.Options.BlueScreen
End Sub
Thanks Aaron, works very nicely indeed.

May I Ask how you knew found (and thus how to search for) the specific command.

For example if it was selecting any of the other options in the Tools>Options menu, how do you know the syntax to access the particular option?

regards,

Oorang
06-12-2008, 06:27 AM
Well there two ways. You could (from the Visual Basic Editor) press F2 to launch the object browser and search for the word "Blue". Or you could turn on the macro recorder, change the screen blue and then look through the code it generated.

xluser2007
06-12-2008, 07:01 AM
Cheers,

I should read the macro recorded code more thoroughly going forward.

This is helpful for future reference when I do need to change basic option settings.

Thanks again :thumb.