create a textbox from VBA

L

Lisa

I have a similar example on how to draw a rectangle and put text into it.
But how do I set the line around the box to "no line" and how do I set the
font and font size?

I have searched the VBA help but without any luck. So I was just hoping for
an example doing exactly what I was looking for....But I guess I can find
most of it in the examples you refer to.

Lisa
 
A

Al Edlund

these functions (font, font-size, and 'no-line') all come about by way of
manipulating the cells within an object. The easy way would be to read
either David Edson's book or Graham Wideman's book. However a more 'fun' way
is to experiment with the paragraph, character (char.font, char.size), line
format, and fill format sections of the shape sheet.
Al
 
J

John Marshall, MVP

Or the lazy way.

Use the macro recorder in Visio 2003 and see what results you get.

Sub Macro1()
Dim vsoCharacters1 As Visio.Characters

Application.ActiveWindow.Page.DrawRectangle 2.75, 9.25, 4.75, 8#

Set vsoCharacters1 =
Application.ActiveWindow.Page.Shapes.ItemFromID(1).Characters
vsoCharacters1.Begin = 0
vsoCharacters1.End = 0
vsoCharacters1.Text = "teststring"


Application.ActiveWindow.Page.Shapes.ItemFromID(1).CellsSRC(visSectionObject
, visRowLine, visLinePattern).FormulaU = "0"

Application.ActiveWindow.Page.Shapes.ItemFromID(1).CellsSRC(visSectionCharac
ter, 0, visCharacterFont).FormulaU = "75"

Application.ActiveWindow.Page.Shapes.ItemFromID(1).CellsSRC(visSectionCharac
ter, 0, visCharacterSize).FormulaU = "36 pt"


End Sub

--
John... Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples? http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
 

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