![]() |
#1
|
||||
|
||||
![]()
I created 2 sub for use in X7 that I can add shortcut keys to that will increase and decrease the outline widths of selected objects.
I'm wondering if anyone could look at my code and tell if there is anything i might do differently to streamline the code... Code:
Sub OutlinesIncrease() Dim s As Shape ActiveDocument.unit = cdrPoint For Each s In ActiveSelection.Shapes.FindShapes() If s.CanHaveOutline Then If s.Outline.Width > 0 And s.Outline.Width < 1 Then s.Outline.Width = 1 End If If s.Outline.Width > 1 Then s.Outline.Width = s.Outline.Width + 1 End If End If Next s End Sub Sub OutlinesDecrease() Dim s As Shape ActiveDocument.unit = cdrPoint For Each s In ActiveSelection.Shapes.FindShapes() If s.CanHaveOutline Then If s.Outline.Width > 1 Then s.Outline.Width = s.Outline.Width - 1 End If End If Next s End Sub
__________________
Sean Waiting for a ride in the T.A.R.D.I.S. |
#2
|
|||
|
|||
![]() Code:
Sub IncOutline() Dim s As Shape ActiveDocument.Unit = cdrPoint For Each s In ActiveSelectionRange If s.CanHaveOutline Then With s.Outline .Width = .Width + 1 End With End If Next s End Sub Sub DecrOutline() Dim s As Shape ActiveDocument.Unit = cdrPoint For Each s In ActiveSelectionRange If s.CanHaveOutline Then With s.Outline If Round(.Width, 2) < 1 Then .SetNoOutline Else .Width = .Width - 1 End If End With End If Next s End Sub |
#3
|
||||
|
||||
![]()
Nice Shark, however this doesn't account for objects that might be grouped or selections that contain grouped items. That's why I used FindShapes().
My biggest issue now is getting Optimization to work so that it doesn't take forever to redraw if there are a lot of items selected.
__________________
Sean Waiting for a ride in the T.A.R.D.I.S. |
#4
|
|||
|
|||
![]()
You can use
Code:
ActiveDocument.BeginCommandGroup Optimization = True Code:
Optimization = False ActiveDocument.EndCommandGroup Last edited by shark; 02-09-2015 at 12:41. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setting document outline unit from macro | L_G_D | CorelDRAW/Corel DESIGNER VBA | 2 | 11-02-2010 12:47 |
residual outline | icerat | Jigsaw Puzzle Creator | 2 | 08-01-2009 13:33 |
Table outline and VBA | Vylda | CorelDRAW/Corel DESIGNER VBA | 2 | 24-11-2008 12:48 |
Need Macro for "Convert Outline to Object" | billjones | Macros/Add-ons | 9 | 02-03-2006 08:36 |
Contour/Outline..... | Anonymous | General | 2 | 01-12-2004 01:10 |