Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help aligning text using VBA

Status
Not open for further replies.

jrice174

Civil/Environmental
Joined
Nov 8, 2004
Messages
129
Location
US
I'm trying to center a string of text in a rectangle. When I add the text it goes almost where I want it, but then when I add the alignment properties, it throws it down in the corner. What am I doing wrong?

Pt1(0) = PWidth / 2: Pt1(1) = Hieght / 2
Set objText = ThisDrawing.ModelSpace.AddText(Name, Pt1, 1)
objText.InsertionPoint = Pt1
objText.Alignment = acAlignmentMiddleCenter
 
Try setting your alignment first, then resetting the insertion point.
 
Thanks, that did it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top