views:

784

answers:

4

Is there a way, in Microsoft Word 2007, to set up a style that will highlight VB.NET keywords, just like the Visual Studio IDE does?

A: 

Not easily. What are you trying to accomplish? There are several tools that will generate highlighted HTML or images of your code for use in presentations. (I hope you're not trying to use MS Word as an IDE!)

Eli
no no! I wrote a user manual to a program I wrote. I wanted to include some samples in my manual, but I didn't want to have to manually highlight every keyword manually
icemanind
+4  A: 

copy-paste from visual studio

Jimmy
Yes. It should automatically keep the formatting for you. (I think you need at least VS2005 - not sure)
GalacticCowboy
+2  A: 

Use SciTE to edit your code samples, then use its "Edit / Copy as RTF" command to copy them into Word complete with syntax highlighting.

RichieHindle
+1  A: 

I don't know what it would look like, but I bet you could just make a new style, apply it to the code samples, and iterate through the blocks of text with the style in a macro and do code highlighting in the Macro.

But that's a lot of work, and as others have said, you can copy/paste from a few IDEs and paste syntactically styled code.

Tom Ritter