Re: Populating a listbox or combo box in Visio 2003



Hi Jay,

I've got an example in the the article "Combo Box Table of Contents" located
here: http://www.visguy.com/2006/11/08/combo-box-table-of-contents/

There's code listings in the article, and a downloadable Visio file that has
a combo box on the page, and VBA code behind it.

--
Hope this helps,

Chris Roth
Visio MVP

Free Visio shapes:
http://www.visguy.com/category/shapes
Visio programming info:
http://www.visguy.com/category/programming/
Other Visio resources:
http://www.visguy.com/visio-links/

<jayhankins@xxxxxxx> wrote in message
news:1188963198.103574.74100@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am trying to add a forms 2.0 lisbox or combobox to a visio page. The
box will be populated with data that that comes from an other shape
eventually. The problem is that when I try to use the AddItem method
in a macro I get an object does not support this property or method
error. Here is the code I am trying:

"Sub addItemMacro()
Dim x
Dim index
Set myListBox = ActivePage.Shapes("Sheet.1")
For x = 1 To 5
index = myListBox.AddItem(x)
Next x
End Sub"


This code gives me a type mismatch with AddItem highlighted:

"Private Sub alarmListBox_Click()
Dim index
Dim x
For x = 1 To 10
index = alarmListBox.AddItem(x)
Next x
End Sub"

I am not very skilled at this sort of thing but I can usually muddle
through. However I can't seem to get this to work.

Thanks for your help

jph



.



Relevant Pages

  • Re: Populating a listbox or combo box in Visio 2003
    ... There's code listings in the article, and a downloadable Visio file that has ... Visio programming info: ... The problem is that when I try to use the AddItem method ... Dim index ...
    (microsoft.public.visio.general)
  • Re: Populating a listbox or combo box in Visio 2003
    ... Regarding Visio programming books, here's my review of the newest: ... Dim index ...
    (microsoft.public.visio.general)
  • Re: Radio buttons on Visio page
    ... I didn't even think of the withevents. ... You can put the option buttons on a frame in the Visio page. ... You have to double-click the frame control first to activate the surface. ... Private Sub Document_RunModeEntered ...
    (microsoft.public.visio.developer.vba)
  • Populating a listbox or combo box in Visio 2003
    ... The problem is that when I try to use the AddItem method ... Dim index ... This code gives me a type mismatch with AddItem highlighted: ... "Private Sub alarmListBox_Click ...
    (microsoft.public.visio.general)
  • Re: Radio buttons on Visio page
    ... You can put the option buttons on a frame in the Visio page. ... You have to double-click the frame control first to activate the surface. ... Private Sub Document_RunModeEntered ... show the times in different time zones, and I'd like to select the time zone ...
    (microsoft.public.visio.developer.vba)