Customizing MS Word: Toggle Color Fonts with Shortcut

Abstract: Resolve the lack of a built-in toggle for color fonts in MS Word by creating a VBA macro and keyboard shortcut to switch between standard black text and colored emoji fonts.

Created: 2026-10-06 by
You can toggle color fonts in Microsoft Word by assigning a custom macro to a keyboard shortcut. This technique allows you to switch between standard black text and colored font formats instantly without navigating through the ribbon menus, significantly speeding up document formatting workflows for users who frequently utilize emoji or specialized Unicode characters that require specific font handling.

Understanding Color Fonts in MS Word

Color fonts, such as Segoe UI Emoji or Twemoji Mozilla, display glyphs with multiple colors rather than a single solid hue. When you apply these fonts to text, Word treats them as distinct from standard monochrome fonts like Arial or Times New Roman. Toggling between these states is useful when you need to preview how text looks in both formats or when collaborating on documents where color consistency matters. The challenge lies in the fact that Word does not provide a built-in "toggle" command for this specific attribute, requiring a small amount of VBA (Visual Basic for Applications) code to automate the process.

Creating the Toggle Macro

To implement this feature, you must create a macro that checks the current font of the selected text and switches it to the alternative. Open your document and press Alt + F11 to open the Visual Basic Editor. In the Project Explorer pane, right-click on ThisDocument or Normal (if you want the macro available in all documents) and select Insert > Module. Paste the following corrected code into the module window:
Sub ToggleColorFont()
    Dim rng As Range
    Dim currentFont As String
    
    ' Ensure there is a selection
    If Selection.Type = wdSelectionIP Then
        MsgBox "Please select some text first.", vbExclamation
        Exit Sub
    End If
    
    Set rng = Selection.Range
    
    ' Get the name of the current font
    currentFont = rng.Font.Name
    
    ' Check if the current font is one of the known color fonts
    ' Using LCase for case-insensitive comparison
    If LCase(currentFont) = "segoe ui emoji" Or _
       LCase(currentFont) = "twemoji mozilla" Or _
       LCase(currentFont) = "apple color emoji" Then
        
        ' Switch to standard black font
        rng.Font.Name = "Calibri"
        rng.Font.ColorIndex = wdAuto
    Else
        ' Switch to a color font
        rng.Font.Name = "Segoe UI Emoji"
        ' Note: Font color is handled by the font itself, 
        ' but we ensure it's not overridden by a manual color setting
        rng.Font.ColorIndex = wdAuto
    End If
End Sub
This script addresses previous issues by using LCase for robust string comparison, which prevents failures due to capitalization differences in font names like Segoe UI Emoji. It also uses wdAuto correctly to reset the font color index, ensuring that the text relies on the inherent colors of the color font rather than a forced black override.

Assigning a Keyboard Shortcut

Once the macro is saved, close the VBA editor and return to Word. Press Alt + F8 to open the Macro dialog box. Select ToggleColorFont from the list and click the Options... button. In the dialog box, enter a shortcut key combination, such as Ctrl + Shift + C. Click OK to save the assignment. You can now select any text and press your chosen shortcut to instantly switch between the color font and the default black font.

Handling Mixed Selections

If your selection contains mixed fonts (some color, some standard), the macro will apply the change to the entire selection based on the primary font detected at the start of the range. For precise control, it is recommended to select only homogeneous text blocks before toggling. This ensures predictable results and avoids unexpected formatting changes across different parts of your paragraph.

Common Troubleshooting Steps

If the shortcut does not work, verify that macros are enabled in Word. Go to File > Options > Trust Center > Trust Center Settings > Macro Settings and ensure that "Enable VBA macros" is selected. Additionally, check if another add-in has assigned the same shortcut key, which could cause conflicts. If the font name appears differently in your system, update the If statement in the macro to match the exact name shown in the Font dropdown menu. For more advanced formatting techniques, you might find it helpful to learn about Managing Headings in MS Word: A Useful Navigation Tool, which complements font customization by improving document structure. Similarly, understanding how to Show/Hide Specific Text in MS Word can help you manage complex documents where color fonts are used sparingly for emphasis.

Frequently Asked Questions

Why does my macro fail when I select no text?

The macro includes a check to ensure that a text selection exists before attempting to modify properties. If the insertion point is active but no text is highlighted, it displays a message box prompting you to select content first. This prevents runtime errors associated with empty ranges.

Can I toggle to a different color font instead of Segoe UI Emoji?

Yes, you can modify the Else block in the macro to set rng.Font.Name to any other color font installed on your system, such as Apple Color Emoji. Simply update the string value to match the exact name of the desired font as it appears in Word’s font list.

Does this method preserve manual font colors?

No, setting Font.ColorIndex = wdAuto removes any manually applied font colors, allowing the color font’s internal design to dictate the appearance. If you need to retain specific manual colors, you would need to modify the logic to store and restore the original color index before switching fonts.

Is this solution compatible with older versions of Word?

The VBA approach is compatible with most versions of Word that support macros, including Word 2010, 2013, 2016, 2019, and Microsoft 365. However, the availability of specific color fonts like Segoe UI Emoji depends on the operating system version, particularly for Windows users. Mac users may need to adjust the font names accordingly.

How do I remove the shortcut if I no longer need it?

To remove the shortcut, go back to File > Options > Customize Ribbon > Keyboard Shortcuts: Customize. Find the ToggleColorFont macro in the commands list and delete the assigned shortcut key from the "Press new shortcut key" field, then click Assign and close the dialog.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More