Solved

How do I display Visio Shape's list value?

Posted on 2007-11-26
4
2,545 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
Comment Utility
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
Comment Utility
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
Comment Utility
Forced accept.

Computer101
EE Admin
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever created a custom Visio stencil – a collection of your own unique master shapes – and then created a drawing by dragging masters onto the drawing page? Have you then made changes to the stencil master and wondered why the shapes on the …
David Parker’s latest book, Microsoft Visio 2010: Business Process Diagramming and Validation, will give you the tools to turn flowcharts and other business diagrams into valuable, data-driven corporate assets. Armed with the knowledge you’ll gain f…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now