Macros to delete track changes and comments

L

lkthompson

Is there a macro code that I could use to remove all track changes and
comments (not just hide them) before saving and sending a document? I've
tried the Reject and Accept Changes, but sometimes if I click Reject all
changes, it takes away changes that weren't tracked to begin with. And I
always have to go to View > Markup, making sure that markup is checked, in
order to reject and accept. Sometimes I'll have to delete comments
separately, sometimes I just click Accept all changes and it gets rid of
them. Is there one process that will work the same for everyone? (everyone
here is upgrading to 2003 and we have to republish some old docs)

This is confusing to instruct others about, since docs were saved in
different ways with different kinds of markups. I don't want to use the
Remove Hidden Data tool because it messes up templates and other settings.

thanks
 
G

Greg Maxey

This has not been extensively tested, but appears to do what you ask:

Sub TC()
Dim oRev As Revision
Dim oCom As Comment
Dim i As Long
For Each oRev In ActiveDocument.Revisions
oRev.Accept
Next oRev
For i = ActiveDocument.Comments.Count To 1 Step -1
ActiveDocument.Comments(i).Delete
Next i

End Sub
 
L

lkthompson

Wow, thanks Greg! It did work..I just accepted all changes after it removed
everything!! I was trying to test it a second time, but could not find the
macro again. I have do not usually use macros, so I don't know how to save
them. I thought it was saved, but what are the steps to save? When I open the
documents and go to View/Visual Basic then click on the arrow to run macro,
it isn't there...

thanks again
 
L

lkthompson

Thanks again. I tried the file save and the first time I ran the macro, I saw
it on the macro list, and it ran fine. However, after I closed word and
reopened the same document (I did not save changes), when I tried to run the
macro (went to visual basic toolbar and tools/macros), it wasn't on the list!
I even tried the one called Macro1, because I thought that's what I might
have saved the other as, but that didn't work either. Do you have to create
the macro each time? I just want to be able to see it in the macro list so
it's easier to run.

thanks
 
G

Greg Maxey

Put the macro in the template project vice the document. And then you
will have to save the template before exiting Word.
 
L

lkthompson

Thanks so much for all your help!

I actually just downloaded a patch to fix Adobe 7, and it took care of it,
so now it's able to save. Kind of strange but it works!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top