Deleted Version reappears in Word 2002 and 2003

  • Thread starter Thread starter Tom Grant
  • Start date Start date
T

Tom Grant

Through automation, I delete the most recent version by the following code:

activedocument.Versions(2).delete

I then save and close the document by the following code:

activedocument.Save
activedocument.close

Then next time I open the document, the version that I deleted is still
listed.

I checked before saving that the version that I deleted was no longer a
member of the Versions collection.

What is going on here? Anyone else have this problem? Any suggestions?

Tom
 
Hi Tom,

Versions are about as stable as the Master Document feature, not very... I
wouldn't use them.

If you open a copy of this file and delete the version through the user
interface, save, close and re-open (IOW emulate the macro actions) is it
successfully removed?

Sometimes, Word won't actually save changes if something hasn't been done in
the document body. If you have the code insert, then delete, some text does
that make any difference?
Through automation, I delete the most recent version by the following code:

activedocument.Versions(2).delete

I then save and close the document by the following code:

activedocument.Save
activedocument.close

Then next time I open the document, the version that I deleted is still
listed.

I checked before saving that the version that I deleted was no longer a
member of the Versions collection.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
 
Thank you for replying. I appreciate it.

Everything works as I would expect if I use the user interface. I only get
this problem with automation.

After posting this question, I did a little more searching in newsgroups and
found many post from you advising people not to use the versioning offered
by Word. So, I decided not to take the risk and have implemented my own
versioning system.

So, it made me smile when I came back to my post and saw that you, in
particular, had replied. It was your advise to others that had already
helped me.

Thanks,
Tom
 
Hi Tom,
So, it made me smile when I came back to my post and saw that you, in
particular, had replied.
Everything works as I would expect if I use the user interface. I only get
this problem with automation.
Interesting. OK, something like this I just have to test :-) I set up a quick
test in a new Word 2003 document. Created two versions, saved, closed,
re-opened then ran ActiveDocument.Versions(1).Delete. Looked (it was gone),
saved, closed, re-opened. And it was still gone.

So, it's not a basic problem in Word 2003. My best guess would be that the
document structure where this was being managed was damaged. Just FYI for the
next person who does a search <g>

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
 
I had a question about the following statement that you made:
So, it's not a basic problem in Word 2003. My best guess would be that the
document structure where this was being managed was damaged. Just FYI for the
next person who does a search <g>

When you say 'document structure', do you mean that a particular document
got corrupt? I have tried this over and over again using new documents and
I get the same result. Or do you mean that I have a corrupt version of Word
2003 on my computer?

Thanks Tom
 
Hi Tom,
When you say 'document structure', do you mean that a particular document
got corrupt? I have tried this over and over again using new documents and
I get the same result. Or do you mean that I have a corrupt version of Word
2003 on my computer?
I meant that the particular document must be corrupt, yes. If it's happening
to new documents, perhaps your Normal.dot template is no longer 100% healthy?
Have you tried renaming that so that Word will generate a new one?

Otherwise, perhaps there's something you're doing differently in setting the
documents up or in your code...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
 
Back
Top