Solved

VBA code snippets in a Word 2016 document

Posted on 2016-09-22
3
164 Views
Last Modified: 2016-09-26
I want to create a library of VBA code in Word.
Is there a way of pasting the code so that it preserves formatting, tabs etc? (and remove spellcheck!)

Thanks.

Also, I'm open to suggestions on how/where to create such a library.
0
Comment
Question by:hindersaliva
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Assisted Solution

by:xtermie
xtermie earned 250 total points
ID: 41811144
You could actually use a word document to create your library, but is better to copy paste your code in the VBA window (press Alt+F11) so that the code is saved in your "library" document OR even better if you want to use these macros in any Word file, Open the VBA windows and Create a NewMacros Module in the NORMAL document
0
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 250 total points
ID: 41811162
Is there a way of pasting the code so that it preserves formatting, tabs etc? (and remove spellcheck!)

a) Use a "monospaced slab serif typeface" (font) like Courier New.
b) Select the entire content of the document ([CTRL]+[A]), then...

For MS-Word 2003:

Select the ("Tools") "Language" ("Set Lanuage...") menu option, & check the "Do not check spelling or grammar" check-box setting.

For MS-Word 2007, 2010, 2013, & 2016:

On the [Review] tab, in the "Language" group, click "Language", & then click "Set Proofing Language".
Set the "Do not check spelling or grammar" check box appropriately.
0
 

Author Comment

by:hindersaliva
ID: 41816455
Thanks all.
I now use Crayon Syntax Highlighter on a Wordpress site. I've posted a new question to go to the next step of copy/pasting to Word and keep the formatting.
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question