altering authorship of tracked changes in Word 2003

User jsmith has been making tracked changes on a Word doc on two different computers. Computer A did not have the user info set, and Computer B did, so half the changes show up as the generic "Author" and half show up as "jsmith".

I've fixed the user info on Computer A (tools > options > user info), but this is only good for new tracked changes going forward; it does not affect existing changes. So to Word, it still looks like there were two different people making the edits, and as a result, two different colors.

So here's the question: Is there a way to alter the underlying authorship of existing changes en masse? Maybe a VB script?

We'd prefer not to resort to (a) individually cutting/pasting (time-consuming), (b) using the Remove Private Data tool (I believe this anonomyzes everything to "Author"; we want "jsmith"), or (c) losing the "by author" color functionality for subsequent people who will edit the document?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pc3000Author Commented:
Ah, that's the most promising thing I've seen so far. I've tested it and it works, but the downside is that if the word "Author" (or whatever username I'm trying to replace) appears in the body of the text, it'll get replaced as well. I'm poring over the code to see what parts of the code I need to be looking at just to change the meta-data...hmm.
Try running the following code
Sub ChangeRevisionAuthorName()

Dim strOldAuthorName As String
strOldAuthorName = "Author"

Dim strNewAuthorName As String
strNewAuthorName = "jsmith"

Dim i As HTMLProjectItem

For Each i In ActiveDocument.HTMLProject.HTMLProjectItems
    i.Text = Replace(ActiveDocument.HTMLProject.HTMLProjectItems(1).Text, "cite=" & Chr(34) & "mailto:" & strOldAuthorName & Chr(34), "cite=" & Chr(34) & "mailto:" & strNewAuthorName & Chr(34), Compare:=vbTextCompare)


End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

pc3000Author Commented:
Perfect - thank you!

irudyk - jumped me on this one, my suggest was going to be that you only do a find/replace which more conditions.

I like the code provided... my idea would be the find/replace where you find a string such as:


replace with


So if jsmith is in the article (not proceeded immediately by "mailto:"), then the find "is not going to find it" and thus leave "author" in place.

If it is a piece of text, such as J Smith, then a wildcard search *J Smith should work, because you would never have a letter right before J Smith

The card was sent byJ Smith. It would be... the card was sent by J Smith, thus *J Smith, should not find it.

Hopefully these solutions get you going in the right direciton.

On a side note, that link I sent you was something I didn't know about. I can't believe the break-down of the structure in the MS Script Editor, you can really do a lot via that window!!!

pc3000Author Commented:
I'm already tweaking the code so that I can roll this out to other users...lots of people seem to have the problem. The only disappointing thing is that if you're running 2007 and 2003, you can't even get into MS Script creating a VB script is the only way to go.

I think I've successfully been able to generalize the code with Application.Username instead of jsmith, that way it'll pull the current user info from Word's settings without having to customize the macro for each person.
pc3000Author Commented:
Arg, even the vb script won't work for my 2007 users... looks like MS got rid of the HTMLProject command altogether in 2007. Ah well, at least my 2003 users will be happy.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.