OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   Accessing .Cost & .Comments in Object Data (http://forum.oberonplace.com/showthread.php?t=1393)

ghamor 04-03-2006 14:47

Accessing .Cost & .Comments in Object Data
I can read the .StaticID property and read and write the .Name property.

I can neither read nor write the .Cost or the .Comments properties, nor a new property I added, called .Field0.

Here's the code that doesn't work when it gets to the .Comments property. I get and error 438 "Object doesn't support this property or method."

I bet it's something fundamental. Can anybody help?



Sub Setup()
Dim s As Shape
Dim x As Double, y As Double, w As Double, h As Double
Dim i As Double
Dim c As Double
Dim Control

Set Control = UserForm1.Controls("ListBox1")

ActiveDocument.ReferencePoint = cdrBottomLeft
c = 0
For Each s In ActiveDocument.ActivePage.Shapes
c = c + 1
Next s

Dim conarray()
ReDim conarray(c, 3)

c = 0

For Each s In ActiveDocument.ActivePage.Shapes
s.GetBoundingBox x, y, w, h, True
s.Selected = True
conarray(c, 0) = s.StaticID
conarray(c, 1) = s.Name
conarray(c, 2) = s.Comments '**** This line generates the error ****
'MsgBox ("Active Selection = " + Str(s.StaticID) + ", Name = " + s.Name)
c = c + 1
Next s
Control.List() = conarray

End Sub

shelbym 04-03-2006 17:54

The line that generates an error should read like this:

conarray(c, 2) = s.ObjectData("Comments")
Hope it helps,


ghamor 06-03-2006 10:50


Thanks so much!

I deduced from your comment that I could also set the Comments property by

s.ObjectData("Comments") = conarray(i, 2) ' save data to the Comments property

All this is working beautifully! :)

Thanks Again!


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

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