Automate version creation? and comparison?

M

mscertified

I need to write a macro that will run each time a document is closed and any
changes have been made. I want to automatically do a 'save as' to a different
name. I am attempting to automate the saving of different versions. I also
need to display a prompt so comments can be entered about the changes made.
Is this possible?

What I would also really like (and this is a lot trickier) is to somehow be
able to display a list of all the existing versions of a document and then
automatically be able to open any 2 versions with the differences highlighted.
 
D

Doug Robbins - Word MVP

For the saving part, see the article "How to save a document using a
filename that gets incremented by 1 each time if the filename already
exists" at:

http://www.word.mvps.org/FAQs/MacrosVBA/SaveIncrementedFilename.htm

Where do you intend the comments about the changes made to be stored?

If in the template from which the document is created, you have a macro
named FileSave, that macro will run when the document is saved (if the
template is available to the machine on which the document is being saved).
In that macro, you could have code to display a userform or InputBox into
which the user would enter the information, but the question remains, where
are you going to store the information.

One possibility would be in a document variable.

For the second part of your quest, you could have a userform with a list box
that gets populated with a list of the documents after you perhaps select
the folder and enter the "root" part of the filename. Then if you used the
document variable approach, you could have code associated with the listbox
that displayed in textboxes on the userform the values of a the document
variable that was contained in two selected documents.


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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