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.

I have a lots of code(for Excel) in Vba and would like to transfer a copy of it into a word document.

Does anyone know of a macro that will format the word document to treat the code as if it were in VBA?

So things like, "For" "And" "Or" "Then" would be changed to Blue and the font would be the same.

I'm not really looking to actually code in word but make a "look-a-like" I have no experience with VBA in word so I can't write myself (otherwise I would, of course checking first to make sure that there isn't one readily available I can use.)

share|improve this question

1 Answer 1

up vote 4 down vote accepted

i found a Word plugin that can handle VBScript highlightning here : http://www.regexlab.com/sswater/en/wordsyntax/index.htm (maybe you could adapt it for VBA specific syntax if you can access the code).

By the way, seems like MZTools can handle it on the VBEditor, maybe you could get the code to use it inside a Word document : http://www.mztools.com/v3/features.as

share|improve this answer
You answered the question + a question I didn't even ask!! Thanks Alot!! –  B-Ballerl Jul 11 '11 at 6:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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