Text size to follow scaling of object

T

Torben Espersen

I've been creating several homemade shapes.
In these shapes have I put some letters and some numbers to give
informations about the shape.

When I insert these shapes into drawings where the sacling is different from
time to time OR if I want to scale the shape smaller or larger by myself,
then the text size remains the same(e.g. 12p) though the shape is scaled.
I would like the text to scale together with the shape and to remain at the
same place in the shape, so that I can use the shape in any kind of drawing
with any kind of scaling

What can I do?
 
A

Al Edlund

I do it by first adding a couple of user functions to the shape with the
information with code

objRect.Name = "textfield_" & CStr(intFieldNr)

' make sure we have a user section in the shape

If objRect.SectionExists(visSectionUser, False) = False Then _

objRect.AddSection(visSectionUser)

blnResult = funcAddUserPropertyToShape(objRect, "width", "width", "width", _

objRect.Cells("Width").ResultIU, "width")

blnResult = funcAddUserPropertyToShape(objRect, "height", "height",
"height", _

objRect.Cells("height").ResultIU, "height")

blnResult = funcAddUserPropertyToShape(objRect, "pinX", "pinX", "pinX", _

objRect.Cells("pinx").ResultIU, "pinX")

blnResult = funcAddUserPropertyToShape(objRect, "piny", "piny", "piny", _

objRect.Cells("piny").ResultIU, "piny")



objcell = objRect.Cells("width")

objcell.Formula = "user.width*(ThePage!DrawingScale/ThePage!PageScale)"

objcell = objRect.Cells("height")

objcell.Formula = "user.height*(ThePage!DrawingScale/ThePage!PageScale)"

objcell = objRect.Cells("pinx")

objcell.Formula = "user.pinx*(ThePage!DrawingScale/ThePage!PageScale)"

objcell = objRect.Cells("piny")

objcell.Formula = "user.piny*(ThePage!DrawingScale/ThePage!PageScale)"

objRect.Cells("Para.HorzAlign").Formula = visHorzLeft

this way the shapes (rectangles with text) always stay the same relative
size on the page
Al
 
G

GregD

an easier way is to go into the shapesheet for the piece of text, and go to
the section called "Character" in the field called "size" and replace whats
there with
this (ThePage!PageScale/ThePage!DrawingScale)*Height

Simple as that.

GregD
www.VisioCafe.com
 

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