OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 19-02-2016, 04:26
WernerHo WernerHo is offline
Junior Member
 
Join Date: Jan 2008
Posts: 20
Default Little Makro extremely slow

Hi out there
I have a little Macro that is working with Rectangles with Text copied from another Program.
The Makro only changes the Fillcolor and the Borderline of these Rectangles
and does nothing with the Text.
The Makro:
Code:
Option Explicit
Sub Thor_o_Mat()
Dim shp As Shape
Dim OrigSelection As ShapeRange
ActiveLayer.Paste
   Set OrigSelection = ActiveSelectionRange
   ActiveSelection.Ungroup
For Each shp In ActivePage.Shapes
If shp.Type = 3 Then
shp.Fill.ApplyNoFill
   With shp.Outline
        .Type = cdrOutline
        .Width = 0.003
        .Color.CMYKAssign 0, 100, 100, 0
   End With
End If
Next shp
End Sub
The Makro works, but if I start it on the Screen the (ca. 20) Objects are flashing for about 10 Seconds until the work is done and much longer if there are more Rectangles.
Is the VBA in CorelDraw X4 extremly slow or is there a big Bug in my Makro.
Any Suggestions?
Every Tip would be nice.
Regards
Werner
Reply With Quote
  #2  
Old 19-02-2016, 14:39
WernerHo WernerHo is offline
Junior Member
 
Join Date: Jan 2008
Posts: 20
Default

Found a Solution in another forum
May be it helps somebody else
Now it looks like this:
Quote:
Option Explicit
Sub Thor_o_Mat()
Dim shp As Shape
Dim OrigSelection As ShapeRange
ActiveDocument.BeginCommandGroup "Schilder"
Optimization = True
EventsEnabled = False
ActiveDocument.SaveSettings
ActiveDocument.PreserveSelection = False
ActiveLayer.Paste
Set OrigSelection = ActiveSelectionRange
ActiveSelection.Ungroup
For Each shp In ActivePage.Shapes
If shp.Type = 3 Then
shp.Fill.ApplyNoFill
With shp.Outline
.Type = cdrOutline
.Width = 0.003
.Color.CMYKAssign 0, 100, 100, 0
End With
End If
Next shp
ActiveDocument.PreserveSelection = True
ActiveDocument.RestoreSettings
EventsEnabled = True
Optimization = False
ActiveDocument.EndCommandGroup
ActiveWindow.Refresh
Application.Refresh
Application.CorelScript.RedrawScreen
End Sub
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
X3 slow then 12... why? Kursad General 11 12-10-2007 09:29
corel X3 slow to copy and paste mick classen CorelDRAW/Corel DESIGNER VBA 5 29-03-2007 14:05
Why does this code run so slow? Webster CorelDRAW/Corel DESIGNER VBA 3 20-03-2007 05:18
Urgent: I need Tiler-Script as a CorelDraw11-Makro Layout-herber CorelDRAW/Corel DESIGNER VBA 1 22-04-2003 21:44
First Makro! First Error! Superfreak CorelDRAW/Corel DESIGNER VBA 2 18-02-2003 13:09


All times are GMT -5. The time now is 14:02.


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