Document Editing Problems

How to Create Text Shortcuts and Format Bold Text with VBA in Word

Phi Hung VoPhi Hung Vo Oct 28, 2026 869 views

Question details

The user wants to assign multi-letter shortcut keys for inserting specific text and needs a VBA script to insert bold text followed by an unformatted space.

How to Create Text Shortcuts and Format Bold Text with VBA in Word
Product
Microsoft Word / WPS Writer
Device & OS
not provided
Scenario
Automating repetitive text insertion and precision formatting using shortcuts or VBA macros.
Observed behavior
Word does not allow unmodified letter sequences as macro shortcuts, and standard VBA text insertion often carries over bold formatting to subsequent spaces.
Before you start

Before creating macros or text shortcuts, ensure the Developer tab is enabled in your word processor to access VBA features, and verify that your desired shortcut sequence isn't a common word used in normal typing.

Solution 1Recommended

Use AutoCorrect or AutoText for Multi-Letter Shortcuts

Since macro shortcuts generally require Ctrl or Alt modifier keys, use AutoCorrect or AutoText to trigger text insertions using ordinary multi-letter sequences without interfering with standard typing.

Unmodified letters are reserved for typing, meaning you cannot assign a macro directly to a string of plain text letters. AutoCorrect is the most efficient native alternative for this workflow.

1
Open AutoCorrect Options

Navigate to 'File' > 'Options' > 'Proofing' and click on the 'AutoCorrect Options' button.

2
Set Up the Text Shortcut

In the 'Replace' box, type your desired multi-letter shortcut (for example, type 'dukesc'). Ensure this is a sequence of letters you do not normally type.

3
Define the Replacement Text

In the 'With' box, type the full text you want to insert (for example, 'DUKE:'). Click 'Add' and then 'OK' to save the shortcut.

Use AutoCorrect or AutoText for Multi-Letter Shortcuts
Efficient Document Editing with WPS Office

Automate Text Insertion and Formatting in WPS Writer

WPS Writer offers robust tools for text automation, including an intuitive AutoCorrect feature and full support for VBA macros in advanced versions. You can easily set up multi-letter shortcuts or write scripts to automate complex document formatting tasks.

  1. 1. Download and Install WPS Office: Get the free WPS Office suite from the official website and launch WPS Writer.
  2. 2. Access AutoCorrect Settings: Click on 'Menu' > 'Options' > 'Spell Check' to find the AutoCorrect configurations.
  3. 3. Create Text Shortcuts: Enter your desired shortcut text and its replacement, then click 'Add' to automate your typing workflow.
  4. 4. Utilize VBA Macros: Navigate to the 'Developer' tab to access the VBA editor, where you can paste and run your formatting scripts.
Fully compatible with Microsoft Word document formats (.docx, .doc).Intuitive AutoCorrect settings for quick, multi-letter text substitution.Advanced VBA macro support for complex formatting workflows.Lightweight, fast performance for daily document editing.
microsoft office alternative - wps office

Frequently Asked Questions

Why can't I use regular letters as macro shortcut keys in Word?

Macro shortcuts typically require modifier keys like Ctrl, Alt, or Shift. Assigning an unmodified letter sequence as a shortcut would interfere with normal typing, as the word processor wouldn't be able to distinguish between typing a regular word and triggering a macro command.

What is the difference between AutoCorrect and AutoText?

AutoCorrect automatically replaces specific sequences of characters with predefined text instantly as you type. AutoText is a type of Building Block that stores text or graphics, which you must insert manually from a gallery or by typing a shortcut and explicitly pressing F3 or Enter.

How do I prevent VBA formatting from affecting the next word I type?

To prevent formatting like bold or italics from bleeding into subsequent text, use the Range object in VBA to collapse the selection to the end of your inserted text. Then, insert a space and explicitly turn the formatting off by setting properties like `.Font.Bold = False`.