Hi Al
I found this feature very interesting, and I tried to put it on a Visio 2002 document. What I did was
- I copied your code and I put it on the ThisDocument
-Then on a shape I create an Action in the Actions section with the command RUNADDON("ThisDocument.subAntiScaling")
But when Call this procedure nothing happens. My questions are
- where I put the code and how to execute this procedure
- How can applie this procedure to more than one text box
thanks
JM
Your Code is bellow
Public Sub subAntiScaling(objRect As Visio.Shape, intFieldNr
Dim objcell As Visio.Cel
Dim blnResult As Boolea
On Error GoTo AntiScaling_Er
objRect.Name = "textfield_" & intFieldN
objRect.AddSection visSectionUse
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"
Set objcell = objRect.Cells("width"
objcell.Formula = "user.width*(ThePage!DrawingScale/ThePage!PageScale)
Set objcell = objRect.Cells("height"
objcell.Formula = "user.height*(ThePage!DrawingScale/ThePage!PageScale)
Set objcell = objRect.Cells("pinx"
objcell.Formula = "user.pinx*(ThePage!DrawingScale/ThePage!PageScale)
Set objcell = objRect.Cells("piny"
objcell.Formula = "user.piny*(ThePage!DrawingScale/ThePage!PageScale)
objRect.Cells("Para.HorzAlign").Formula = visHorzLef
Exit Su
AntiScaling_Err
If Err > 0 The
Debug.Print "Err in AntiScaling " & Err & " " & Err.Descriptio
End I
Resume Nex
End Sub