Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question already has an answer here:

I have an XML snippet in Notepad++ that I would like to share with a co-worker via email. In Notepad++ the syntax highlighting nicely shows off the elements and attributes. Here is a sample picture:

XML

When I copy/paste this in Outlook only the text comes over. The Outlook email is set to HTML. I have also verified in Word only the text is pasted.

There are separate Copy to Clipboard menu items but they look focused on filenames. Is there an option or extension that will copy the formatting as well as the text?

share|improve this question

marked as duplicate by Scott, Dave M, Renan, 8088, Dave Rook Apr 5 '13 at 8:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Possible duplicates superuser.com/questions/125210/…, superuser.com/questions/60760/…, superuser.com/questions/39571/… The solution seems to be to use Plugins > NppExport –  ernie Apr 4 '13 at 18:48
    
@ernie Doh and I have NppExport installed and searched for an answer here first. Thanks you can add as an answer and I will accept –  Brad Patton Apr 4 '13 at 18:51
add comment

1 Answer 1

up vote 4 down vote accepted

Copy and paste of Breakthrough's answer for a similar question:

You can use Notepad++ to accomplish this in three ways. Just so you know, Notepad++ is a more advanced version of Notepad, which supports syntax highlighting of different code files "out of the box" - PHP included!

Download & install it, fire it up, and load up your PHP file. You should automatically see it beautifully coloured (if not, because the file extension is something other than .php, go to Language -> PHP or Language -> P -> PHP).

If you need to change any of the colours, you can easily do so - just go to Settings -> Styler Configurator. From that menu, you can change the various highlighting and font options, to suit your needs - although the default usually suffices for most.

Then, go to Plugins -> NppExport. From there, you have three options you can consider:

  • Export to RTF
  • Export to HTML
  • Copy all formats to clipboard

Start with the last one - "Copy all formats to clipboard" - which will copy the entire file with the highlighted syntax to the clipboard. Once you click it, then open Microsoft Word, and just hit paste! You should see the beautifully syntax-highlighted code. If something goes wrong, then you can try one of the other options (export to RTF/HTML), although I've never had a problem with the clipboard method.

Possible duplicates How to make syntax highlighting for source code in Outlook 2007 email?, Syntax highlighting in Microsoft Office Word, How do I easily highlight the syntax of PHP code in Word?

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.