0

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.

  • 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
0

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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.