Thread: [Solved] Kill the file based on date
View Single Post
 
Old 07-14-2014, 05:22 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The nearest Word equivalent of that would be:
Code:
Private Sub Document_Open()
If Date > DateSerial(2014, 7, 10) Then
  With ThisDocument
    .Saved = True
    Kill .FullName
    Application.Quit
  End With
End If
End Sub
As I've already said, though, you can't delete an open document.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote