Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I display Visio Shape's list value?

Posted on 2007-11-26
4
Medium Priority
?
2,758 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 31

Accepted Solution

by:
Scott Helmers earned 2000 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 31

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

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

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…
Book Review: Using Microsoft Visio 2010 by Chris Roth   Disclaimer: The author of Using Visio 2010 is a friend and fellow Visio MVP. Whether you’re new to Visio or are upgrading to Visio 2010 from a previous version, you will find a lot to like…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Screencast - Getting to Know the Pipeline
Suggested Courses

916 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