Solved

VBA code snippets in a Word 2016 document

Posted on 2016-09-22
3
87 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
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

My experience with Windows 10 over a one year period and suggestions for smooth operation
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
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…

777 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