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 would like to be able use some sort of C++ style commenting for Microsoft Word.

E.g. If I have

// line of text

the entire line should be a comment and should appear in a different colour.

Same goes for:

/*

text block

*/

I would want text block to be in a different colour than my main text.

Another feature that would be nice but not necessary for me to have is some sort of a way to quickly strip all the comments.

I have no idea how this could be done, if possible.

Any ideas?

Thanks.

share|improve this question
    
related Stack Overflow question: stackoverflow.com/questions/1070614/… –  Ivo Flipse Apr 7 '10 at 21:36
1  
This could be possible by setting up a comment style (which only goes until the end of the line in case of // comments); and then make // and /* resp. react on auto-format which in turn triggers the style. –  Debilski Apr 7 '10 at 23:05
    
Can you 'prove' that with a screenshot/example? Else I'm sure it would get accepted as an answer –  Ivo Flipse Apr 8 '10 at 10:58

1 Answer 1

If your comments are delimited /* and */ then stripping them and delimiters all in one go is possible with Search for (/\*)*(\*/) and Replace with nothing. /{2}*^l should locate an entire line beginning // and ending with a line break (may look like a one but is an el).

Having located text in this way it can be "deleted and then reinserted" with changed formatting (eg font colour) by replacement with ^& in the Replace box formatted to suit.

Note that the above searches and replacements would require Use wildcards being ticked.

share|improve this answer

Your Answer

 
discard

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