Hack 38 Turn Comments into Regular Text![]() ![]() This hack shows you how to replace a comment''s reference with its text and author. Comments let reviewers annotate the text without interfering with the text. But if you later import the document into another program, such as Quark or FrameMaker, those comments can cause trouble. Also, when you save a file as a plain-text (.txt) file, you lose any comment references, and the comments end up tacked on at the end, out of context. In many cases, you can just delete all the comments [Hack #36], but if those comments contain important instructions for a compositor, or other useful information, you may prefer to incorporate the comments into the text and set them off with a bit of markup. A macro can quickly convert those comments into regular text, while retaining their positions in the document.
4.13.1 The CodeThis macro replaces each comment reference in a document with the text of the comment itself and adds the name of the comment''s author at the end. The entire entry is surrounded in brackets and styled with the built-in Emphasis character style, as shown in Figure 4-20. Figure 4-20. A Word comment converted to text![]() Place this macro in the template of your choice [Hack #50] and either run it from the Tools dialog or put a button for it on a menu or toolbar [Hack #1]. Be sure your cursor is currently in the main text of the document when you run this macro. Sub ConvertCommentsToInlineText( ) Though the code never explicitly deletes the comments, Word removes them when the macro replaces their references with text. 4.13.2 Hacking the HackRather than retaining the comments within the text, you can create a separate document containing just the comments. The following macro creates a table listing each comment in a document, along with the comment''s author. The table is created in a new, blank document. Sub CreateTableOfComments 4.13.3 See Also[Hack #95] |