I need a way to execute a macro in my main GMS file whenever a PageChange or PageActivate event occurs in any open CDR file. Is this possible?
I see that there are PageChange and PageActivate events in the ThisDocument module of the currently active document, but this limited scope won't be helpful as I need the event to be triggered for any document. Any help is appreciated.
I think you can use GlobalMacroStorage_DocumentOpen event to define someting like new CurDoc as Document when you open any document. And then use CurDoc_PageActivate.
Hi Shark. I didn't get a notification of your post, so I'm glad I checked.
I think I follow what you are describing and I'll test it out. Although, I can't imagine how a macro stored in GlobalMacroStorage could create a variable/object "CurDoc" for every file that is opened, and then have that somehow call a function in my main GMS file. Maybe it will just work when I get into it, but it seems like the pieces won't communicate with each other.
That did the trick! It's working exactly the way I needed it to. Thank you so much, Eskimo!
Hey, I'm glad to hear that worked for you!
Now that everything is in place I'm noticing that there is an issue with the global macros not "activating" and being unresponsive when CorelDraw first launches until after a few documents are opened and closed. Any idea why this might be happening and what can be done to get these macros working immediately with the first document that Corel opens?
Tools | Options | CorelDRAW | VBA Uncheck the Delay Load VBA checkbox
Shelby, you da man! That did the trick. Thank you so much!
I've gotta say, I love the community here. You, Eskimo and shark_ are always so helpful. Thank you all and God bless you.