Ordering of Custom Properties?

S

Scott Metzger

Hi,

I have several Shapes that have Custom Properties. I am trying to add
new Custom Properties and re-arrange the order of them. However, when I
delete the first property and then add a new property it always gets put
down as the first property. How can I make sure a newly added Custom
Property gets put on the end of the list?

Or better yet, how can I re-order a given set of Custom Properties?

I am using Visio 2002.

Thanks,
Scott Metzger
 
S

Scott Metzger

Note: I am speaking of the actual order in the shape sheet not the sort
order. I need to adjust the actual order becuase my Automation depends
 
A

al

only partly facetious since you asked about reordering
them - have you considered the brute force approach of
read them into an array, delete all of them, and then
recreate them?
 
S

Scott Metzger

al said:
only partly facetious since you asked about reordering
them - have you considered the brute force approach of
read them into an array, delete all of them, and then
recreate them?

Deletion and Recreation is the only way that I have found to do this.
The problem with doing this is that once you delete that row any
references to cells in that row are removed from the ShapeSheet. Also,
if you rename rows then any references to cells in the ShapeSheet now
point to the wrong cell, because when you rename a row all references to
the renamed row are also changed.

So, the only way I have found to do this is to:
1) Note all the names of my custom properties.
2) Note every place each of these names is used in my ShapeSheet,
thankfully it seems to be limited to the Text Fields section.
3) Delete all my custom properties.
4) Create new custom properties, in the order I want them.
5) Go through the shape sheet and put the references to the Prop.XXX rows.

This excercise is a result of Filters only being able to be identified
by a row index instead of a "Prop.Name" in Automation. And it is also
the result of not being able to change the order of Custom Properties in
a Shape Sheet.

Tell me again, Visio is supposed to save me time, right?
 
A

al

I understand. In my case I save the custom properties
definitions in a database (long term) and in a listview
control for the document. I had to do this because the
defaults delivered with some stencils was inconsistent for
what I needed.
good luck
al
 
J

John Marshall, MVP

I checked with Graham and his response is:


Because this is such a pain, I finally wrote a tool to do it using a new
feature in Visio 2003. It's included with the 2003 book, soon to be
released.

A not-quite-automatic way to reorder named rows which is way less hassle
than using the ShapeSheet is this:

1. Save the doc in XML (VDX) format.

2. Use text editor to change the IDs for the rows in question. No need to
change any other formulas.

3. Save the XML file, then load back into Visio -- should be in desired
order now.

This procedure obviously requires V2002 or above. If using V2003, then
before doing this you need to change a reg setting to get editable XML:

HKCU\Software\Microsoft\Office\11.0\Visio\Application

XMLEmitIndents = 1

(and to make this easier, set the Visio Option > Advanced "Put all settings
in Windows Registry).

Hope that helps,

Graham Visio MVP


John... Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples? http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
 
S

Scott Metzger

I checked with Graham and his response is:


Because this is such a pain, I finally wrote a tool to do it using a new
feature in Visio 2003. It's included with the 2003 book, soon to be
released.

Thanks. At least I know I didn't miss some easy way to do this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top