modified date

R

red6000

Hi, I;m using the following code to display the modified date of the active
document:

Dim dlvVersions As Office.DocumentLibraryVersions
Dim dlvVersion As Office.DocumentLibraryVersion
Dim strVersionInfo As String
Set dlvVersions = ActiveDocument.DocumentLibraryVersions
If dlvVersions.IsVersioningEnabled Then
strVersionInfo = dlvVersion.Modified
End If

MsgBox (strVersionInfo)

Set dlvVersion = Nothing
Set dlvVersions = Nothing

But it's debugging at:

Set dlvVersions = ActiveDocument.DocumentLibraryVersions

saying that 'No versions exist for this file'

Any ideas where I'm going wrong?

thanks.
 
D

Doug Robbins - Word MVP

What version of Office are you using? If it is Office 2007, checking the
Help file for versions reveals the following under the topic of "What
happened to versioning?"

Quote

The Versioning feature isn't available in Microsoft Office Word 2007. If you
save a document that contains versioning in the Microsoft Office Word
97-2003 file format and then open it in Office Word 2007, you will lose
access to the versions.
Important If you open the document in Office Word 2007 and you save the
document in either Word 97-2003 or Office Word 2007 file formats, you will
permanently lose all versions.

Use the Version Extraction Tool

You can save versions of a document as multiple files by using the Version
Extraction Tool (VET), which is included in the Office Migration Planning
Manager (OMPM). The OMPM and the VET are available on the Microsoft TechNet
Web site.

Unquote

You would have to question then why code similar to that which you posted
still appears in the Visual Basic Help file in Word 2007.
--
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
 
J

Jay Freedman

Is the active document stored in a SharePoint library? I think you'll
get that error message whenever you're executing against a document
that isn't in SharePoint. If that's the case, you should include an On
Error statement that diverts execution to an error handler.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

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