OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-12-2002, 06:57
Rick Randall
Guest
 
Posts: n/a
Default Speeding up a macro

Hi---In an effort to speed up a macro I used this:

Code:
   Sub test()

            Optimization = True
            EventsEnabled = False
            ActiveDocument.SaveSettings
            ActiveDocument.PreserveSelection = False

             'does the macro
            
             ActiveDocument.RestoreSettings
             EventsEnabled = True
             Optimization = False
             ActiveWindow.Refresh
             
             End Sub
This speeds it up a lot. However, when I work I use a docker with the Object Manager, and Graphics and Text Styles, open. Each time a drawing is opened during the macro these dockers refresh, slowing down the macro. Can anyone tell me how to turn these dockers off while the macro is running?
Thanks!
Reply With Quote
  #2  
Old 12-12-2002, 10:33
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Speeding up a macro

Rick, what version of CorelDRAW do you use?

The easiest method would be to use VBA's SendKeys method and simulate keystrokes for Windows>Docker>... menu items. However you still need to find out if the docker is actually there before you send those keys. You can use FindWindow from Windows API to try to locate the docker window if it's already open.

You could use SendMessage Windows API function to show/hide the docker instead of resorting to SendKeys... Anyway, let me know your Draw version and I will try to come up with some solution that would work in your case.

Oh, did I mention that there isn't an easy way to handle dockers through CorelDRAW's object model?
Reply With Quote
  #3  
Old 12-12-2002, 10:51
Rick Randall
Guest
 
Posts: n/a
Default Dockerz

Iam using CorelDraw 11, but will need the same code for 10 if possible.
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
How can I make a macro time out? Rick Randall CorelDRAW/Corel DESIGNER VBA 6 09-02-2005 11:16
Adding a Reference on a pwd protected macro Rick Randall CorelDRAW/Corel DESIGNER VBA 9 27-10-2004 09:27
An Idea for a handy and easy to make macro vallentin Macros/Add-ons 2 16-03-2004 11:35
New macro to clip curves w.r.t. a border Gerard Hermans Macros/Add-ons 0 09-06-2003 07:50
closing dockers/interactive toolbars to speed up a macro Rick Randall CorelDRAW CS 1 09-12-2002 20:39


All times are GMT -5. The time now is 16:25.


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