Drop text on visio drawing

Started by suhaspatil3007, January 17, 2012, 12:44:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

suhaspatil3007

Hi

i need help to draw a text box (or text (A) button in visio) on visio drwaing using vba.

anybody knew, how to to drop text box on drawing?

thanks in advance.

Paul Herber

There's nothing special about a text box, it's just a simple rectangle with no border and no fill (unless the shape is themed). .
Just use the Page.DrawRectangle method, then add the text you need.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

gwideman

Quote from: suhaspatil3007 on January 17, 2012, 12:44:00 PM
Hi

i need help to draw a text box (or text (A) button in visio) on visio drwaing using vba.

anybody knew, how to to drop text box on drawing?

thanks in advance.

Yeah, what Paul said. 

Use APage.DrawRectangle(...) and then hide the lines through one of several different ways. 

A text shape that you create via the Text button hides its geometry by setting LinePattern to 0 (actually THEMEGUARD(0) ), but you could also set Geometry1.NoLine to TRUE.

http://msdn.microsoft.com/en-us/library/ff765984.aspx

-- Graham

nashwaan

Another similar approach would be:

Set AShape = APage.DrawRectangle( .... )
Call AShape.DeleteSection(Visio.visSectionFirstComponent)


Now you have a shape without a geometry that doesn't get affected by formatting or themes.
Of course, you may add text to it.

Yousuf.
Give me six hours to chop down a tree and I will spend the first four sharpening the axe — Abraham Lincoln