![]() |
#1
|
|||
|
|||
![]()
Hi Folks,
I would like to close all open paths in my multi page/single page document without selecting them individually. Can a macro automate this task by using corel's Arrange>Close Path>Closest nodes with straight lines option? Thanks for reading and answering Last edited by macrofan; 26-11-2009 at 17:32. |
#2
|
||||
|
||||
![]()
you mean like this?
Code:
Sub closeThePaths() Dim s As Shape Dim sr As ShapeRange Set sr = ActiveLayer.Shapes.All For Each s In sr s.Curve.Closed = True Next s End Sub |
#3
|
||||
|
||||
![]()
oh..multiple pages, forgot.
Will this work? Code:
Sub closeThePaths() Dim p As Page Dim s As Shape Dim sr As ShapeRange For Each p In ActiveDocument.Pages p.Activate Set sr = ActivePage.Shapes.All For Each s In sr s.Curve.Closed = True Next s Next p End Sub |
#4
|
|||
|
|||
![]()
Hi John,
Your macro is working partially. I have a very special scenario where the open paths are disguised in the combined paths (because I mostly import my text as curves from MS word through .prn) Unless I break every curve apart the macro doesn't function you know it's so tedious to break every curve apart then run the macro. So can you suggest a code that can examine the open curves inside the combined paths? Once again thanks for the earlier ones that you have posted. See the attached .cdr file for more info. |
#5
|
||||
|
||||
![]()
looks like the spam fairy attacked last night...
Maybe this'll work: Code:
Sub closeThePaths() Dim p As Page Dim s As Shape Dim sr As ShapeRange For Each p In ActiveDocument.Pages p.Activate Set sr = ActivePage.Shapes.All.BreakApartEx For Each s In sr If s.Type <> cdrTextShape Then s.UngroupAll End If Next s Set sr = ActivePage.Shapes.All For Each s In sr If s.Type <> cdrTextShape Then s.BreakApart End If Next s Set sr = ActivePage.Shapes.All For Each s In sr If s.Type <> cdrTextShape Then s.Curve.Closed = True End If Next s Next p End Sub |
#6
|
|||
|
|||
![]()
Hi john,
I really thank you for taking personal interest in my problem and sorry for giving you constant trouble. We are almost there towards achieving our desired goal the only thing left is after closing all open curves, can it be possible to combine the objects in the same state that they were broken apart from? I hope I am clear when I say that in the same state from where they were broken apart from, Let me explain, suppose I have letter O and letter A, I want them to be combined in their original states. see the attached file. |
#7
|
||||
|
||||
![]()
Hi,
Not sure if I'm following exactly. You can add ActiveSelection.Combine on it's own line right after s.BreakApart Hope this helps. -John |
#8
|
|||
|
|||
![]()
Hi John,
I think you are following it all right It's me who has made it complicated. Ok let's remove the confusing things. I first said, it should apply on all pages without having to select any thing. But then I realized I don't need that, and I am sorry for that. Now the macro should close the paths inside a group of various curves selected (No text involved at all in all of this process, as I import text as curves). Your macro does exactly what I want but forgets to combine the shapes that it breaks apart. I am attaching a small sample of what I have to deal with, for you to experiment with, I would love if you can add one more feature of auto convert the Grayscale black to CMYK black, and if you notice it has No outline but with the RGB mode, if you can convert that no outline to CMYK as well that would be great too. Once again thanks for taking interest in my problem. By the way your suggestion of adding a new line after the breakapart line didn't work. |
#9
|
|||
|
|||
![]()
Attachment didn't show up in previous message
|
#10
|
||||
|
||||
![]()
I'll check it out.
I had a brain fart too...on that last post. lol -John |
![]() |
Tags |
close path |
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 |
Best way to Close a form | RobC | CorelDRAW/Corel DESIGNER VBA | 2 | 19-09-2009 02:30 |
Text to path macro... | patcho519 | Macros/Add-ons | 0 | 16-01-2008 11:57 |
cannot close combined shape | jemmyell | CorelDRAW/Corel DESIGNER VBA | 5 | 27-07-2005 15:25 |
How to use close path in a VB routine? | jconnor | CorelDRAW/Corel DESIGNER VBA | 1 | 02-04-2005 04:15 |