Solved

How do I display Visio Shape's list value?

Posted on 2007-11-26
4
2,651 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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 …
Periodically someone asks me whether there’s a way to automatically convert all of the pages in a Visio drawing to PowerPoint slides. There have even been a few times when I’ve wanted to do that myself but I never really had enough incentive to figu…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

623 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