Hey guys, a few months ago I started programming in Corel. I added 4 or 5 fields to the Object Data, and I remember there being some difficultly with getting them to show in the Docker compared when to I was entering them in the Field Editor. I don't remember how exactly I got them to display. Maybe a close and reopen of Corel.
Fast forward to now, and I am unable to Create New Field. I click "Create New Field," it takes me to a blank line that I cannot type in. I double click the field and cannot type. I even tried to add the new data fields via VBA and as soon as I "add them," they do not exist, haha.
Is there something I am missing? Anyone else experience this?
Zeke
Loveland, CO
What version of CorelDRAW are you running?
Corel 2019 (64 BIT)
Version 21.3.0.755
I guess we'll see if I hear back from Corel Support. What are the capabilities of using the Properties? I'm not sure if that would work. My end goal is not to have the user access the information, so it sounds like it has potential. So instead of adding a Data field, I could add as many Properties as I'd like to an object?
A Property is addressed by specifying a Name (String) and an ID (Long). So, you can store multiple pieces of information using one Name, but with different ID values. So, something like:
Shape.Properties("MyProperty1",1) = "foo"
Shape.Properties("MyProperty1",2) = "bar"
is the sort of thing I have used it for.
In my Saved View Areas macro, I use document Properties and page Properties to store the information about the stored views.
One possible inconvenience comes from the fact that you can't directly include such Properties directly in a CQL query. Shelby Moore has posted about how that can be done using a custom function.
Okay, follow up question - once I add Properties data to shapes, save document, and close the document, if I reopen it, the data/propterties seems to disappear. Is there something else that I am missing?
I just tried using this in 2019 on a shape, and it worked as expected when I opened the same document later.
Sub save_shape_properties() Dim s As Shape Set s = ActiveShape s.Properties("MyProperty1", 1) = "foo" s.Properties("MyProperty1", 2) = "bar" End Sub '------------------------------------------------------------- Sub check_shape_properties() Dim s As Shape Set s = ActiveShape MsgBox "MyProperty1, ID 1: " & s.Properties("MyProperty1", 1) MsgBox "MyProperty1, ID 2: " & s.Properties("MyProperty1", 2) End Sub
Ahhh, I see what I did. I was migrating information from some ObjectData to the properties. I had some numbers in object data that it appears I needed to convert to a string in order store it in the properties.