![]() |
#1
|
||||
|
||||
![]()
hi everyone,
if i wanted to check to see if a file has been modified or saved in any way (at close time) how would I do this... or can it be done? For example... if i open a file... do nothing and close it.. nothing happens! But if i open the file, modify it... and then save it... when I close the file I want a script to run because the file had been modified or saved since it was opened! is this possible? I've used ActiveDocument.Dirty to flag a file for save... and I've been able to check if the file has been saved by using "If ActiveDocument.Dirty = True then....." but I'm not sure how to make it check if it has EVER been "Dirty" since it's been opened. Any suggestions? As always... thanks in advance! B |
#2
|
||||
|
||||
![]()
This might work, just the first thought off the top of my head. Use the DocumentBeforeSave Event to check if the file is dirty, if so save a document property. Then on the DocumentClose check your custom property to see if the file has ever been dirty. You will also want to clear this property on the opening of each document. Here is the code.
Code:
Private Sub GlobalMacroStorage_DocumentBeforeSave(ByVal Doc As Document, ByVal SaveAs As Boolean, ByVal FileName As String) If Doc.Dirty = True Then Doc.Properties(Modified, 1) = Doc.Dirty End If End Sub Private Sub GlobalMacroStorage_DocumentClose(ByVal Doc As Document) If Doc.Properties(Modified, 1) = "True" Then 'Run your code End If End Sub Private Sub GlobalMacroStorage_DocumentOpen(ByVal Doc As Document, ByVal FileName As String) Doc.Properties(Modified, 1) = "" End Sub -Shelby |
#3
|
||||
|
||||
![]()
as always my friend... you are the best!
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
group check | bprice | CorelDRAW/Corel DESIGNER VBA | 6 | 16-12-2008 18:30 |
Folder Check | norbert_ds | CorelDRAW/Corel DESIGNER VBA | 2 | 13-01-2008 21:18 |
Please someone check this! | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 9 | 31-03-2006 19:46 |
ExtSearch modification to multiple select | adirx | CorelDRAW CS | 0 | 23-12-2005 18:06 |
How to check presence effects? | G-Kir | CorelDRAW/Corel DESIGNER VBA | 3 | 22-06-2005 07:11 |