OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 05-07-2003, 12:43
Posts: n/a
Default How do I reference ArtisticText objects? "Shape Index o


Thanks for your time.

I need to reference a text object so that I can use its properties. But this...

Set shp = CorelDRAW.ActiveDocument.ActivePage.ActiveLayer.Shapes("Speaker1")
Always gives me the "Shape Index is Out of Range" error - although Speaker1 exisits.

Strangely this...

sName_Graphic = "Speaker" & iSpeaker & "_Icon"

Set shpGraphic = drwApp.ActivePage.ActiveLayer.Shapes(sName_Graphic)
works when trying to reference a powerclip object.

What's the difference?

Reply With Quote
Old 10-07-2003, 15:59
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default Re: How do I reference ArtisticText objects? "Shape Ind

I hope you have an object with the Name "Speaker1" (as set in Object Manager), so when you select this object, CorelDRAW reports in its status bar "Speaker1 selected on Layer 1" or something like that. If you have just a text object which has "Speaker1" text in it, this won't work.

If you do have an object named "Speaker1", then make sure it is not part of a group, and, obviously, it is on the current layer (because you used ...ActiveLayer.Shapes...).

If the object is within a group, then you will need to use FindShape instead of Shapes collection. This method can iterrate inside groups:

Set shp = ActiveLayer.Shapes.FindShape("Speaker1")
This is for CorelDRAW 11. In CorelDRAW 10, FindShape method is not available on Shapes collection, but is on the layer itself, so you will need to use it like this:

Set shp = ActiveLayer.FindShape("Speaker1")
This should do the trick.
Reply With Quote

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
Automatically generate colour index numbers from 8-bit palet Jast New product ideas 3 07-07-2005 14:02
I need to update objects visibility faster NEHovis Corel Photo-Paint VBA 0 18-07-2003 08:54

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

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