?
Solved

VBA code snippets in a Word 2016 document

Posted on 2016-09-22
3
Medium Priority
?
221 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 1000 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 1000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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