• Home
  • About 404TS
  • Contact

404 Tech Support

Where IT Help is Found

  • Articles
    • Code
    • Entertainment
    • Going Green
    • Hardware, Gadgets, and Products
    • Management
    • Network
    • News
    • Operating Systems
    • Security and Privacy
    • Software
    • System Administration
    • Talking Points
    • Tech Solutions
    • Web
    • Webmaster
  • Reviews
  • Media
    • Infographics
    • Videos
  • Tech Events
  • Tools
    • How do I find my IP address?
    • Browser and plugin tests
  • Get a Technical Consultation
You are here: Home / Articles / Software / Creating a style in Word 2013 for code snippets

Creating a style in Word 2013 for code snippets

2013-11-25 by Jason

In the midst of writing a paper this weekend, I needed to include some segments of code in the paper. Word is good at formatting text to follow the standard paragraph format but it could use a little help when it comes to displaying code. So, I set out to create a style just for code which would give it a nice little box, stop it from being spellchecked, and preserve the formatting.

To start with, I copied my code from Notepad++. Under the Plugins menu and NppExport, there is a function called ‘Copy HTML to Clipboard’ which works very well to preserve the formatting.

I pasted that into Word 2013 and immediately received some red squiggles under variable names and function calls. I then highlighted the code in Word and clicked the drop-down arrow (down arrow with a horizontal line over it in the bottom-right corner) on the Home tab in the Styles section. From the menu that expanded, I chose Create a Style.

A new window popped up with the title “Create New Style from Formatting”. I named the style Code and hit the Modify button to make some tweaks to it. This brought up another window with many options to it.

modify_style

In the bottom-left corner is a Format button, providing access to a lot more settings that can be tweaked for the style. I started by fixing the spell-checking within the code snippet by selecting Language.

format_button

Inside the Language settings, I checked the box “Do not check spelling or grammar”.

nospellcheck

From there, I returned to the Modify window and chose the Format drop-down again. This time, I went to Border and selected Box for the Setting.

border_box

I didn’t quite like the spacing, so under the Modify window I chose Format and went to Paragraph this time. I increased the spacing after and checked the box to “Don’t add space between paragraphs of the same style” so there wouldn’t be spacing inside the code snippet but this gave a more comfortable gap between the code box and the next normal paragraph.

paragraph_spacing

Finally, I hit ok to see the new Code style applied to the selected text and I liked the look.

code_snippet_demo

 

 

Filed Under: Software

Trending

  • Mozilla Introduces BrowserID To Manage Logins Across Browsers
    In Media, Security and Privacy
  • Social media is making us narcissistic
    In Infographics
  • How large is Microsoft? [infographic]
    In Infographics

Latest Media Posts

Find Out Where To Download SNES ROMs

Find Out Where To Download SNES ROMs

Multifunctional Video Conversion Tools – Wondershare Video Converter

Multifunctional Video Conversion Tools – Wondershare Video Converter

  • Popular
  • Latest
  • Today Week Month All
  • Access to the resource [servershare] has been disallowed Access to the resource [servershare] has been disallowed
  • What is the AllJoyn Router Service on Windows 10? What is the AllJoyn Router Service on Windows 10?
  • How a DirecTV bill really works in 2015 How a DirecTV bill really works in 2015
  • Read the Event Logs on Windows Server Core Read the Event Logs on Windows Server Core
  • SOLVED: “This modification is not allowed because the selection is locked.” SOLVED: "This modification is not allowed because the selection is locked."
  • How Virtual Reality Supports Mental Health Therapy How Virtual Reality Supports Mental Health Therapy
  • Key Strategies of Successful Coin Listing on Exchange Key Strategies of Successful Coin Listing on Exchange
  • Keeping Your Mac Healthy: A Comprehensive Guide to Maintenance and Troubleshooting Keeping Your Mac Healthy: A Comprehensive Guide to Maintenance and Troubleshooting
  • Making Distributed Software Development Work: Strategies and Best Practices for Managing Remote Teams Making Distributed Software Development Work: Strategies and Best Practices for Managing Remote Teams
  • customer contactless payment for drink with mobile phon at cafe counter bar,seller coffee shop accept payment by mobile.new normal lifestyle concept The Latest Innovations In Payment Technology
Ajax spinner

Elevator Pitch

404 Tech Support documents solutions to IT problems, shares worthwhile software and websites, and reviews hardware, consumer electronics, and technology-related books.

Subscribe to 404TS articles by email.

Recent Posts

  • How Virtual Reality Supports Mental Health Therapy
  • Key Strategies of Successful Coin Listing on Exchange
  • Keeping Your Mac Healthy: A Comprehensive Guide to Maintenance and Troubleshooting

Search

FTC Disclaimer

404TechSupport is an Amazon.com affiliate; when you click on an Amazon link from 404TS, the site gets a cut of the proceeds from whatever you buy. This site also uses Skimlinks for smart monetization of other affiliate links.
Use of this site requires displaying and viewing ads as they are presented.

Copyright © 2025 · Magazine Pro Theme on Genesis Framework · WordPress · Log in