textbox w/ bullets

J

Joe

I am using Visio 2002 and need to create a key for lines on my diagram.

I would like to have a bulleted list which contains text and line patterns. It would look like this:

* 100 BaseT LAN ------------
* 1.5 GHz XXX --*--*--*--*--
* >4.5 GHz YYY -**-**-**-**

Where the text would be followed by a line pattern. Is it possible to apply color to either the text or the line pattern?

Is it possible to do this?

TIA,
 
A

Al Edlund

This was posted previously and might provide some help...
Al

The characters object can to set text formatting and to analyze text in the
shape.

Markus' linked sample below show use the characters object to add formatting
and there by often add rows to the characters section. You can find other
examples that use the characters object to set formatting and add fields in
the Visio 2003 SDK. Once you've installed the SDK, from the Microsoft
Office Visio 2002 SDK menu item off programs select the Code Librarian
viewer. In the viewer select a language (VB6, VB.net or C#) then go to the
shapes node and scroll down to text. There are two text formatting samples.
The Visio 2003 SDK can be downloaded here. ,
http://www.microsoft.com/downloads/...bd-b0bb-46e7-936a-b8539898d44d&displaylang=en

While you can't actually get the first column labels you can get similar
information form the Characters object. The Characters object deals with
fields a bit differently then the labeling in the ShapeSheet window. To
analyze the text in the shape, use the .RunBegin and .RunEnd properties of
the Characters object. The VBA code below provides a simple example of
analyzing text using RunBegin and RunEnd. It expects the active window to
be a drawing type window and for at least one shape to be selected. It
analyzes the text in the first shape in the selection and find runs of text
in the shape that corresponds to each of the rows in the characters section.

Sub GetCharRows()

'For simplicity work on the first shape in the selection
Dim vsoShape As Visio.Shape
Set vsoShape = ActiveWindow.Selection.Item(1)
Dim intCharCount As Integer
Dim intRunEnd As Integer
Dim intRunBegin As Integer
Dim i As Integer
i = 0

Dim vsochars As Visio.Characters
' The initial characters object return from the Characters Property of the
shape spans all the text in the shape,
Set vsochars = vsoShape.Characters
intCharCount = vsochars.CharCount

While (i + 1 < intCharCount)
' Set the characters object to span one character
vsochars.Begin = i
vsochars.End = i + 1
' Find the set of characters that share formatting with this character
intRunEnd = vsochars.RunEnd(Visio.VisRunTypes.visCharPropRow)
intRunBegin = vsochars.RunBegin(Visio.VisRunTypes.visCharPropRow)
' Set the characters object to span this run
vsochars.Begin = intRunBegin
vsochars.End = intRunEnd
' Update i so that the next time through the loop, we'll look at the
first character after this run.
i = intRunEnd
' Output some helpful information about this run.
Debug.Print "Row Info: Row Number = " &
vsochars.CharPropsRow(Visio.visBiasLeft) & " CharCount " &
vsochars.CharCount
Debug.Print " Run Begin = " & intRunBegin & " Run End " & intRunEnd
'The text in this run may contain returns to make it easier to see what
text belongs to each run, wrap the text in tags.
Debug.Print "<Text>" & vsochars & "</Text>"

Wend

End Sub

-Heidi
Microsoft Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top