OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26-10-2005, 04:21
zaum
Guest
 
Posts: n/a
Default powerclip extract

Hi! I'm newbie in VBA and I can't make a very easy macro..

I need to extract all powerclip contents (from objects and from outlines) on page and delete these.

Can somebody help me?
Reply With Quote
  #2  
Old 26-10-2005, 06:57
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Here you go...

Code:
Sub DeletePowerclips()
    Dim s As Shape
    Dim sr As ShapeRange
    Dim srPowerClips As New ShapeRange
    
    ' Find all powerclips (omit powerclips inside powerclips)
    For Each s In ActivePage.FindShapes()
        If Not s.PowerClip Is Nothing And s.PowerClipParent Is Nothing Then
            srPowerClips.Add s
        End If
    Next s


    ' Now extract and delete contents of the powerclips
    For Each s In srPowerClips
        Set sr = s.PowerClip.ExtractShapes
        sr.Delete
    Next s
End Sub
Reply With Quote
  #3  
Old 26-10-2005, 07:26
zaum
Guest
 
Posts: n/a
Default

Thank you for fast reply!

The code works good, but only with shapes, when I have curves in document then I become the error warning: 'This shape is not of the correct type to support this property of method.'
And I need extract powerclips from curves too!
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
[BUG] - Fountain fill is'nt rotate in powerclip Kursad General 3 01-07-2005 21:01
How can I extract a piece of a bitmap object using VBA code oswaldon Corel Photo-Paint VBA 2 25-04-2004 19:37
VBA hint to extract CorelDraw images from msWord.doc Henri Socha CorelDRAW/Corel DESIGNER VBA 1 04-04-2003 11:11


All times are GMT -5. The time now is 18:03.


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