logo
search
Office Settings & Configuration

How to Disable AutoCorrect for a Specific Style in Word

Steve KSteve K Oct 7, 2026 870 views

Question details

The user wants to stop Word from automatically capitalizing the first letter of lines for custom styles like Code and Code Block, without disabling AutoCorrect globally.

How to Disable AutoCorrect for a Specific Style in Word
Product
Word
Device & OS
not provided
Scenario
Editing documents containing code snippets where automatic capitalization interferes with the exact syntax.
Observed behavior
Word automatically capitalizes the beginning of lines formatted with custom Code styles, and there is no built-in option to disable this behavior per-style.
Before you start

Keep in mind that Microsoft Word applies AutoCorrect rules globally by default. If you frequently insert code blocks, consider setting up a quick toggle macro or adjusting global settings temporarily.

Solution 1Recommended

Temporarily Disable Automatic Capitalization

Since Word does not allow disabling AutoCorrect for a single style, the most straightforward workaround is to turn off the capitalization rule globally while typing code.

This method involves turning off the specific rule that causes the capitalization issue, allowing you to type your code blocks smoothly. You can easily turn it back on once you return to typing normal text.

1
Open Word Options

Click on 'File' in the top ribbon and select 'Options' at the bottom of the menu.

2
Navigate to Proofing

In the Word Options dialog box, select 'Proofing' from the left-hand navigation pane.

3
Access AutoCorrect Options

Click on the 'AutoCorrect Options...' button located at the top of the right pane.

4
Disable Capitalization

Under the 'AutoCorrect' tab, uncheck the box for 'Capitalize first letter of sentences' and click 'OK' to save your changes.

Temporarily Disable Automatic Capitalization
Quick Undo Shortcut: If you only have a few lines of code to type, you can leave the setting on and press Ctrl+Z immediately after Word automatically capitalizes a letter to revert it to lowercase.
WPS Writer Tips

Manage AutoCorrect Easily in WPS Writer

If you frequently work with code snippets and text, WPS Writer provides a streamlined interface to manage AutoCorrect rules. You can quickly adjust settings to ensure your code formatting remains exactly as typed without navigating complex menus.

  1. 1. Open Settings: Launch WPS Writer, click the 'Menu' button in the top left corner, and select 'Options'.
  2. 2. Access AutoCorrect: In the Options window, click on the 'Edit' tab and look for the 'AutoCorrect' section.
  3. 3. Adjust Capitalization: Uncheck the option that automatically capitalizes the first letter of sentences, then click 'OK' to apply your exact formatting.
Quickly toggle capitalization rules on or offFully compatible with Microsoft Word .docx formatsAdvanced style management for code blocks and textLightweight, fast, and completely free to use
microsoft office alternative - wps office

Frequently Asked Questions

Can I link AutoCorrect to a specific font instead of a style?

No, AutoCorrect rules in Word act at the application level globally. They cannot be tied to specific fonts, paragraphs, or individual styles.

Why does Word capitalize the first letter of my code lines?

By default, Word considers any new line created by a paragraph break (Enter key) as the start of a new sentence, triggering the 'Capitalize first letter of sentences' AutoCorrect rule.

Can I undo an automatic capitalization without changing the settings?

Yes. Immediately after Word capitalizes a letter, press Ctrl+Z. This undoes the AutoCorrect action while keeping the text you typed exactly as you typed it.