Link to home
Start Free TrialLog in
Avatar of Stephen Kairys
Stephen KairysFlag for United States of America

asked on

Word 2013 - Remove all comments

Is there a way to remove ALL comments within a particular document? (e.g. if I have inserted 20?)

If not, perhaps there's another way to accomplish what I need to do. When I was away on vacation, I hand-wrote a number of additions to the document (a novel) in a notebook. I tagged each addition with a letter A, B, C, etc, noting the letter on both the hardcopy of the manuscript, and the notebook.

My next steps is to type the additions into a separate document, again tagged with A, B,, C. I want to insert the same tags into my manuscript...but eventually remove them when I'm ready to merge these additions into the manuscript.

Reason for the above is that I'm in the middle of a previous iteration of the manuscript (Draft 26) and do not wish to enter the changes for Draft 27 until I'm done with Draft 26, which may be a while; however, I want to get them onto my hard drive in the interim.

Thanks,
Steve
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Try this simple (hopefully not simplistic) macro
Sub DelComms()
    Dim cm As Comment
    
    For Each cm In ActiveDocument.Comments
        cm.Delete
    Next cm
End Sub

Open in new window

Avatar of Stephen Kairys

ASKER

Thanks, Graham. Will try later today.
OK silly question of the day.  :)

Where in the UI do I insert macro text (as opposed to RECORDING a macro?)

Thanks.
Open the VBA IDE with Alt+F11.
The Project browser is in the left hand pane. If you have recorded any macros they will be in Normal>Modules>NewMacros. You can open this module by double-clicking the name. Otherwise you can add another module from the menu: Insert>Module. Paste the code in. To run it, click on the code to put the text cursor in the macro and then press F5.
OK, that worked...but when i save my DOCX file, I see...
User generated image
(I'd love to be able to save the macro so it's available for ALL docs, btw.)

Thanks.
It sounds as if you have put the macro in the document's macro project rather than the Normal template's macro project.

Use the Project explorer to check that out.

As you get more into VBA macros you may need to store code into a particular Template, but it is rare to have macro code in a Document.
OK, so how can I quickly insert this macro into the Normal template? Tks.
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Do you mean NORMAL.DOT by the target doc?
Thanks.
I meant that you should have the document with the comments open in Word. Also it should be the active document.
OK, it's pasted into Module1, but how do I save and go back to the open doc? Simply click the red X?

User generated image
Thanks.
The Word document window will still be open, so you jst need to show it. Closing the VBA editor by clicking on the cross ushould do it. You could also minimise it; or you could switch back using Alt+F11again - and not forgetting the Windows Alt+tab keystrokes to switch between all the open windows.
OK! That worked but still getting:
User generated image
How can I save w/o incurring this error?
Thanks for all your patient help.
If your code is in the document, then saving it will drop the code, as the message says. So I suggest that you do that. If the code is also in the Normal template, then nothing has been lost. If it isn't and you want to run the code more times, then make sure that the code is put in a module of the Normal template.
At this point, I can live with running the code only once as it's not something that will happen frequently. I'll just save it off as a doc somewhere and paste it in again as needed. (If needed! :) )
Comment accepted with the caveat that I did not save it in my document.

Graham, thanks again for your help!