Solved

How do I display Visio Shape's list value?

Posted on 2007-11-26
4
2,593 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

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 …
Meetings to discuss business process can waste time, and often do .  The meeting's dialog can get confusing when participants have different professional perspectives and backgrounds.  A jointly-developed process picture helps wade through the confu…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

762 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