Solved

Copy paste to Word 2016 and preseve formatting

Posted on 2016-09-26
7
33 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
[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
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
Office 365 Training for IT Pros

Learn how to provision Office 365 tenants, synchronize your on-premise Active Directory, and implement Single Sign-On.

 

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 18

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 18

Expert Comment

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

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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 …
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.

737 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