I
Ishmael
I've sent this to Microsoft Support but they suggested I
ask here. I want to programmatically remove Document
Versions in code. I have the following macro defined:
Public Sub RemoveVersions()
With ActiveDocument.Versions
Do While .Count > 0
.Item(1).Delete
Loop
End With
End Sub
I created a document with some versions in it and then
removed those versions using the UI (File | Versions...).
I opened the document again using the "Recover Text from
any File" option in the "Files of Type" dropdown. The
document had no trace of the old versions that I could
see. I opened the original copy of the document that
contained versions and ran the RemoveVersions macro. I
opened the Versions dialog and it did not show any
versions. I saved this document to a new filename then
used the "Recover Text from any File" option to open it
again. I could read the previous versions, they were not
removed.
I first noticed this problem when I was using VB to
automate Word. In that case calling the Save method (or
SaveAs) of the document object caused the Versions
collection to re-populate itself as if they had never
been removed. In my opinion, the simplified version of
the problem above (using a macro) is more severe since it
falsely gives the impression that the versions were
successfully removed.
I'm using Word XP SP-2.
Has anyone else seen this problem? How about in Word 2003?
Thanks,
Ishmael Turner.
ask here. I want to programmatically remove Document
Versions in code. I have the following macro defined:
Public Sub RemoveVersions()
With ActiveDocument.Versions
Do While .Count > 0
.Item(1).Delete
Loop
End With
End Sub
I created a document with some versions in it and then
removed those versions using the UI (File | Versions...).
I opened the document again using the "Recover Text from
any File" option in the "Files of Type" dropdown. The
document had no trace of the old versions that I could
see. I opened the original copy of the document that
contained versions and ran the RemoveVersions macro. I
opened the Versions dialog and it did not show any
versions. I saved this document to a new filename then
used the "Recover Text from any File" option to open it
again. I could read the previous versions, they were not
removed.
I first noticed this problem when I was using VB to
automate Word. In that case calling the Save method (or
SaveAs) of the document object caused the Versions
collection to re-populate itself as if they had never
been removed. In my opinion, the simplified version of
the problem above (using a macro) is more severe since it
falsely gives the impression that the versions were
successfully removed.
I'm using Word XP SP-2.
Has anyone else seen this problem? How about in Word 2003?
Thanks,
Ishmael Turner.