OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   Code to determine if shape is powerclip (http://forum.oberonplace.com/showthread.php?t=8235)

noj 18-06-2012 08:39

Code to determine if shape is powerclip
 
I'm going nuts! Can someone please tell me the simplest way to determine if a selected shape is a powerclip or not with VBA code? Based on a thread I found in this forum that Shelby answered, I tried this method:
Code:

Private Sub GlobalMacroStorage_SelectionChange()
    Dim s As Shape
    Set s = ActiveSelection
    If s.PowerClip Is Nothing Then
          UserForm1.CheckBox1.Visible = False
    Else
          UserForm1.CheckBox1.Visible = True
    End If
End Sub

... but it's not working. Am I missing something?

shelbym 18-06-2012 11:40

ActiveSelection
 
You need to be careful when using ActiveSelection, because it returns the selection type and not the shape itself.

Trying changing:
Code:

Set s = ActiveSelection
to
Code:

Set s = ActiveShape
and I bet it will work,

-Shelby

noj 19-06-2012 11:46

Great, thanks shelby. That's better.


All times are GMT -5. The time now is 12:00.

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