Solved

How do I display Visio Shape's list value?

Posted on 2007-11-26
4
2,582 Views
Last Modified: 2012-05-05
How do I reference a user-defined list value on a shape in Visio?

I have a Visio shape, with a user-defined data field: Col_BType, which can be any one of four values in a fixed list.    I am trying to identify the string value selected, but the closest I can get is the fixed list's INDEX value selected!

Here are the details:

Shape Name: selectedShape
Data Field:      Col_BType  (first value selected in fixed list)
Fixed List      Val_a, Val_b, Val_c, Val_d


I can do this:
      selectedShape.Cells("Prop.Col_BType").Formula

...and it returns:
      INDEX(0, Prop.Col_BType.Format)

Arrgh!  I'm so close, but can't quite get there.  I've racked my brain and reviewed every Cells property, to no avail.  I'm just trying to get the value AT Index 0 of Col_BType.Format.

How do I get it to return "Val_a" instead of the freakin' index OF that value??  Help!

0
Comment
Question by:bmclaugh
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
Scott Helmers earned 500 total points
ID: 20370556
This is a problem created in Visio 2007; prior versions stored the resulting list entry in the Value field but Visio 2007 stores the INDEX function pointing to the value (as you discovered).

Fortunately, there is a simple answer. Try this:

      selectedShape.Cells("Prop.Col_BType").ResultStr(0)

and I think you'll get exactly what you need.

BTW, the "0" argument for the ResultStr property directs it to return a string. If you look in the Visio VBA help you'll see that ResultStr accepts a long list of arguments that perform unit conversions on the resulting value, but 0 just passes a string.
0
 
LVL 30

Expert Comment

by:Scott Helmers
ID: 20439755
Hi -- just checking to see whether my posting from November 28th solved your problem. I'm quite sure it's the correct solution. If so, please accept the response and award the points. After all, it's the points that make the EE world go 'round!

Thanks,
Scott
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20658525
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Question Several times in recent years, someone has posted a question at EE asking whether they could display the Windows directory structure – folders and subfolders – using Visio. When one person specifically asked about displaying directory …
The ability to add structure to Visio diagrams using containers, lists and callouts is one of my favorite features in Visio 2010. In this article I’ll describe a mashup of containers and lists that meet a real-world need. Prior to reading this ar…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question