OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   Speeding up a macro (http://forum.oberonplace.com/showthread.php?t=20)

Rick Randall 10-12-2002 06:57

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


  Sub test()

            Optimization = True
            EventsEnabled = False
            ActiveDocument.PreserveSelection = False

            'does the macro
            EventsEnabled = True
            Optimization = False
            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?

Alex 12-12-2002 10:33

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? :)

Rick Randall 12-12-2002 10:51

Iam using CorelDraw 11, but will need the same code for 10 if possible.

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

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