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 05-07-2013, 04:48
buga buga is offline
Senior Member
 
Join Date: Jan 2011
Posts: 114
Default LeaveEditMode recursively

Hello such.

You see, I'm trying to create a macro but can not find the solution.

If we have several powerclips, one inside the other, and I'm in the last PowerClip.

How do I exit the editing mode all at once?

thanks in advance
Reply With Quote
  #2  
Old 05-07-2013, 06:46
grzjanik grzjanik is offline
Member
 
Join Date: Mar 2010
Location: Lodz, Poland
Posts: 86
Send a message via Skype™ to grzjanik
Post LeaveMultiPowerclips

Hi.

The easiest way:

Code:
Sub LeaveMultiPowerclips()
On Error Resume Next
ActiveDocument.ActivePowerClip.LeaveEditMode
ActiveDocument.ActivePowerClip.LeaveEditMode
ActiveDocument.ActivePowerClip.LeaveEditMode
ActiveDocument.ActivePowerClip.LeaveEditMode
ActiveDocument.ActivePowerClip.LeaveEditMode
ActiveDocument.ActivePowerClip.LeaveEditMode
ActiveDocument.ActivePowerClip.LeaveEditMode
ActiveDocument.ActivePowerClip.LeaveEditMode
ActiveDocument.ActivePowerClip.LeaveEditMode
ActiveDocument.ActivePowerClip.LeaveEditMode
End Sub


Regards.

~GrzJanik
Reply With Quote
  #3  
Old 05-07-2013, 07:25
buga buga is offline
Senior Member
 
Join Date: Jan 2011
Posts: 114
Default

Some method more elegant??

thanks anyway
Reply With Quote
  #4  
Old 05-07-2013, 09:33
grzjanik grzjanik is offline
Member
 
Join Date: Mar 2010
Location: Lodz, Poland
Posts: 86
Send a message via Skype™ to grzjanik
Post

Hi.

As an amateur, I wrote this code.
It works but it shows me an error.
If you can fix it and insert the correct code.

Code:
Sub LeaveMultiPowerclips()
Set p = ActiveDocument.ActivePowerClip.Parent
Do
If Not p Is Nothing Then ActiveDocument.ActivePowerClip.LeaveEditMode
Loop Until p Is Nothing
End Sub
Regards.

~GrzJanik

Last edited by grzjanik; 05-07-2013 at 09:46.
Reply With Quote
  #5  
Old 05-07-2013, 11:01
buga buga is offline
Senior Member
 
Join Date: Jan 2011
Posts: 114
Default

I like that. Thank you so much.

Another question.

I can Lock all Shapes of the page, if there Powerclips containing other powerclips?

I would like to Lock those that are inside also powerclips

Thanks in advance

regards
Reply With Quote
  #6  
Old 08-07-2013, 02:42
grzjanik grzjanik is offline
Member
 
Join Date: Mar 2010
Location: Lodz, Poland
Posts: 86
Send a message via Skype™ to grzjanik
Post

Hi.

Maybe helpful:

Code:
Sub LockAllShapesOnCuurentPage()

ActiveDocument.BeginCommandGroup "Lock All Shapes On Current Page"

    Dim s As Shape, ss As Shape, sr As ShapeRange
 
       Set sr = ActivePage.Shapes.FindShapes()

    For Each s In sr

        If Not s.PowerClip Is Nothing Then

            s.PowerClip.EnterEditMode
 
               For Each ss In s.PowerClip.Shapes
                   ActivePage.Shapes.FindShapes().Lock
                Next ss
 
           s.PowerClip.LeaveEditMode
       
 Else
 
           ActivePage.Shapes.FindShapes().Lock
 
       End If

    Next s
 
    ActiveDocument.ClearSelection
    ActiveDocument.EndCommandGroup

End Sub
Greetings

~GrzJanik
Reply With Quote
  #7  
Old 08-07-2013, 03:05
buga buga is offline
Senior Member
 
Join Date: Jan 2011
Posts: 114
Default

Thank you very much. The problem is that if there powerclips within another PowerClip, PowerClip not Lock inside (I guess because the outside is Locked)

I tried with ReverseRange but neither works.
Reply With Quote
  #8  
Old 08-07-2013, 18:46
buga buga is offline
Senior Member
 
Join Date: Jan 2011
Posts: 114
Default

any ideas? I've tried a thousand things and I have not gotten it to work.

thanks
Reply With Quote
  #9  
Old 09-07-2013, 02:21
grzjanik grzjanik is offline
Member
 
Join Date: Mar 2010
Location: Lodz, Poland
Posts: 86
Send a message via Skype™ to grzjanik
Post Lock all objects

Hi.

For me, blocking all objects:



I do not know why does not work for you.

Greetengs.

~GrzJanik
Reply With Quote
  #10  
Old 09-07-2013, 03:09
buga buga is offline
Senior Member
 
Join Date: Jan 2011
Posts: 114
Default

corel x6 use. you?

Also I've noticed that if all shapes are powerclips the code does not work. (no locks or the first PowerClip) if I have more shapes forms as a rectangle, the code works but only in the rectangle and the first Power Clip.

Any help?

The code that is not very useful, but it has become personal.

regards
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 to recursively find powerclip inside powerclip aakkaarr CorelDRAW/Corel DESIGNER VBA 5 26-02-2013 00:54


All times are GMT -5. The time now is 17:33.


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