Aspose::Words::Document::get_VersionsCount method

Document::get_VersionsCount method

Gets the number of document versions that was stored in the DOC document.

int32_t Aspose::Words::Document::get_VersionsCount()

Remarks

Versions in Microsoft Word are accessed via the File/Versions menu. Microsoft Word supports versions only for DOC files.

This property allows to detect if there were document versions stored in this document before it was opened in Aspose.Words. Aspose.Words provides no other support for document versions. If you save this document using Aspose.Words, the document will be saved without versions.

Examples

Shows how to work with the versions count feature of older Microsoft Word documents.

auto doc = MakeObject<Document>(MyDir + u"Versions.doc");

// We can read this property of a document, but we cannot preserve it while saving.
ASSERT_EQ(4, doc->get_VersionsCount());

doc->Save(ArtifactsDir + u"Document.VersionsCount.doc");
doc = MakeObject<Document>(ArtifactsDir + u"Document.VersionsCount.doc");

ASSERT_EQ(0, doc->get_VersionsCount());

See Also