OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > Corel Script > CorelDRAW CS

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-12-2005, 07:33
Geert
Guest
 
Posts: n/a
Default Autorun / autostart macro

Hi,

I want to create a .cdr file that automatically starts a macro. On this forum, I found several topics concerning autorun / autostart macro’s. However, I don’t succeed in getting it to work. I am working with Coreldraw 12. I have tried multiple events like ‘GlobalDocument_Start’ , ‘document_pageactivate’, …. I have put these macro’s in the globalmacros.gsm as well as in the VBAproject - thisdocument.. Nothing seems to work.. The delay load VBA is not checked!

How can I get it to work?
Reply With Quote
  #2  
Old 07-12-2005, 15:13
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Example

I do this all the time. One of my favorite simple scripts is one that zooms to all the objects on open of the document. This is because most of the stuff I draw is large 4 to 5 feet, and doesn't fit on your normal 8.5 x 11 page.

Here is the code for it, and yes remember the delay VBA checkbox must be unchecked for this to work:
Code:
Private Sub GlobalMacroStorage_DocumentOpen(ByVal doc As Document, ByVal FileName As String)

ActiveWindow.ActiveView.ToFitAllObjects

End Sub
Basically one simple line of code, but sure is a nice feature to have. This code is placed under ThisMacroStorage of my own GMS file.

Hope it helps,

Shelby
Reply With Quote
  #3  
Old 03-03-2006, 12:53
Jon Lorber
Guest
 
Posts: n/a
Default ThisMacroStorage

Alex is it possible to call functions from other modules from inside the GlobalMacros.gms? In otherwords I'm trying to run a macro when someone saves a file. Originally I had the code in another loaded module and called it from the save event in the "ThisDocument" section. I can put all the code in the "ThisMacroStorage" but would like to keep it separate. It possible to run call functions in other modules from there?
Reply With Quote
  #4  
Old 03-03-2006, 13:13
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default GlobalMacros

You don't have to put the code in the GlobalMacros.GMS Simply put the code in the ThisMacroStorage Section of your own GMS, found under CorelDRAW X3 Objects. As long as the delay VBA checkbox has been unchecked they will run. This is what I do. Everything is in my own GMS, I have nothing in the GlobalMacros.

Shelby
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Replace Macro Pumpkin_Masher Macros/Add-ons 1 21-09-2005 14:41
Adding a Reference on a pwd protected macro Rick Randall CorelDRAW/Corel DESIGNER VBA 9 27-10-2004 09:27
Autorun Macro without GlobalDocument_OpenDocument joexx CorelDRAW/Corel DESIGNER VBA 6 16-05-2004 10:54
New macro to clip curves w.r.t. a border Gerard Hermans Macros/Add-ons 0 09-06-2003 07:50
Speeding up a macro Rick Randall CorelDRAW/Corel DESIGNER VBA 2 12-12-2002 10:51


All times are GMT -5. The time now is 10:05.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com