At a loss for simple Visio VBA actions

M

Mark Tangard

Newbie to Visio, old timer to VBA (Word & Excel) but floundering horribly in trying to write Visio macros for some simple tasks. (I?d hoped to glean the basics from recorded code, but so far no joy there.) Could someone tell me how to return the "current shape" and "current shape's content" in Visio VBA? I know my terms may be off, but I'm looking for the equivalents to Word VBA?s Selection.ShapeRange(1) and Selection.ShapeRange(1).TextFrame.TextRange.Text for the shape?s content.

The few resource sites I've found have some well-commented code samples, but nearly all show a shape being created first & then adjusted/manipulated/reported. How can I return an *existing* shape that's currently selected, where I obviously wouldn?t know its ID or object name -- and for the other common situation, the shape the cursor is inside of?

Main goal: programmatically adjust the format (Space Before, Line Spacing, Character Spacing, etc.) of text inside a shape -- a task I sometimes must do dozens of times a day.

Seriously grateful for any clues.
 

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