Solved

VBA code snippets in a Word 2016 document

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now