Solved

VBA code snippets in a Word 2016 document

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

734 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