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 05-07-2003, 12:43
andyb
Guest
 
Posts: n/a
Default How do I reference ArtisticText objects? "Shape Index o

Hi,

Thanks for your time.

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

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

Strangely this...

Code:
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?

Andy
Reply With Quote
  #2  
Old 10-07-2003, 15:59
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
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:

Code:
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:

Code:
Set shp = ActiveLayer.FindShape("Speaker1")
This should do the trick.
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
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 11:11.


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