![]() |
#1
|
||||
|
||||
![]()
Been a long time since I have been in here! Hello to everyone!
![]() Quick question... I think I am brain dead this morning... possibly because it's Friday and a long weekend is ahead of me! ![]() I need to compare a filename at close to see if it's the same filename as when I opened the drawing... whats the easiest/best way to do this? In addition, this needs to happen regardless of how many files might be open, or have been opened and closed. Basically, what I am trying to do is if the filename is the same, a script will execute when I close... however if the filename is different (I've done a save-as) the script will not execute... Thoughts? Any and all info is greatly appreciated! ![]() |
#2
|
||||
|
||||
![]()
It is so good to see you again. Welcome back!
Here is my first stab at this. Basically, when the file is opened I save the Doc.Title (example.cdr) to the document.properties. Then when the file is closed, I check to see if the current title matches what it was when the document was opened. This should work no matter how many files are opened and closed. :-) In your GMS file place the following code in the "ThisMacroStorage" section. Code:
Private Sub GlobalMacroStorage_DocumentOpen(ByVal Doc As Document, ByVal FileName As String) Doc.Properties("CheckDocumentName", 1) = Doc.Title End Sub Private Sub GlobalMacroStorage_QueryDocumentClose(ByVal Doc As Document, Cancel As Boolean) If Doc.Properties.Exists("CheckDocumentName", 1) Then If Doc.Properties("CheckDocumentName", 1) = Doc.Title Then MsgBox "I am the same" 'Do Something End If End If End Sub -Shelby |
#3
|
||||
|
||||
![]()
Thank you sir! It's been awhile since I have been around. We have been insanely busy here at work, and I haven't had a chance to create any little scripts in awhile! I'm a little rusty, and I actually missed it!
What you gave me works perfectly! It's exactly what I needed! As always, much appreciated! ![]() |
![]() |
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 |
Get Filename from imported file | ddonnahoe | CorelDRAW/Corel DESIGNER VBA | 2 | 01-06-2007 09:22 |
Filename without extension | norbert_ds | CorelDRAW/Corel DESIGNER VBA | 1 | 18-04-2007 01:05 |
Thumbnails before filename | signweld | General | 2 | 06-06-2006 08:34 |
save filename without extension and prn automation error | olympiatr | CorelDRAW/Corel DESIGNER VBA | 5 | 20-10-2004 08:17 |
Insert Filename & Path | pmills | New product ideas | 4 | 02-09-2003 06:20 |