Solved

Copy paste to Word 2016 and preseve formatting

Posted on 2016-09-26
7
25 Views
Last Modified: 2016-10-18
I want to copy paste some color-coded VBA code (via Crayon Syntax Highlighter on Wordpress site) to a Word 2016 document.

When I do it the usual way it loses the formatting.

Is there a way to paste and keep the beautiful color-coding please? (sample attached)

Thanks
Crayon.JPG
0
Comment
Question by:hindersaliva
7 Comments
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 41816475
0
 

Author Comment

by:hindersaliva
ID: 41816502
Thanks. But it doesn't work for me. I used 'Keep Source Formatting' from Paste Options.

The sample code is here
http://www.excelomgcookbook.com/4-2/

Does it work for you? Anybody?

Thanks
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 41816682
The colours are not in the saved text, but are the result of interpretation by the VBA editor.

You can do it with Notepad++. You can download and use it freely,

Export the code to a .bas file in the VBA IDE and open it with Notepad++. If it isn't immediately coloured, chose VB as the Language setting
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:hindersaliva
ID: 41816712
Graham, I need the code for a teaching book I'm writing in Word 2016. I'd like the code to look nice and pretty as in the Syntax Highlighted code on my Wordpress site.

I'm wondering, is there a 'syntax highlighter' that's a sort-of-plugin for Word?
0
 
LVL 17

Accepted Solution

by:
xtermie earned 500 total points (awarded by participants)
ID: 41816781
You can use the Windows snipping tool to get the code as is (formatted) and paste it in word as an image
That could be very helpful when writing a book as you won't be able to edit the code by mistake while writing the book
1
 

Author Comment

by:hindersaliva
ID: 41816863
Good idea, xtermie. Thanks.
0
 
LVL 17

Expert Comment

by:xtermie
ID: 41847955
Author stated solution provided was a great idea :)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
My experience with Windows 10 over a one year period and suggestions for smooth operation
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

760 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

20 Experts available now in Live!

Get 1:1 Help Now