Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-14-2020, 07:26 PM
Guessed's Avatar
Guessed Guessed is offline How to add multiple different color highlight buttons to toolbar Windows 10 How to add multiple different color highlight buttons to toolbar Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
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

You would need macros to do this via buttons since they aren't built-in. You can do a series of macros to toggle the colours. There is a finite number of highlight colours but if you know the available constant names for the colours then you just build another macro for each one.


Code:
Sub HL1()
  SetHiLite wdYellow
End Sub

Sub HL2()
  SetHiLite wdBrightGreen
End Sub

Function SetHiLite(iCol As Long)
  If Selection.Range.HighlightColorIndex = iCol Then
    Selection.Range.HighlightColorIndex = wdNoHighlight
  Else
    Selection.Range.HighlightColorIndex = iCol
  End If
End Function
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #2  
Old 10-16-2020, 03:39 PM
nhcowboy1 nhcowboy1 is offline How to add multiple different color highlight buttons to toolbar Mac OS X How to add multiple different color highlight buttons to toolbar Office 2011 for Mac
Novice
How to add multiple different color highlight buttons to toolbar
 
Join Date: Mar 2018
Posts: 8
nhcowboy1 is on a distinguished road
Default

Andrew - Thank you for your prompt reply, but I still have some questions . . .

First, I don't understand the longer macro - the one that begins with "function".
Second, how do I find out the names of the different colors?
And, finally, how do I create buttons in the different colors - one for each highlight color?

Thank you!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a "Font color" button and a "Highlight text" button in the Quick Launch toolbar ? gloub Word 12 02-19-2019 03:19 PM
Can I edit macro buttons on the quick access toolbar in excel? appo Excel Programming 2 11-13-2018 10:30 AM
Is it possible to use two of the same toolbar buttons in Word 2007? WaltR Word 3 08-04-2012 03:30 PM
Need to put two highlight buttons on toolbar in different colors davidmrt Word 6 12-11-2011 05:54 AM
How to add multiple different color highlight buttons to toolbar custom toolbar with buttons to open new docs based on templates Brandi Mail Merge 18 06-15-2010 02:10 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft