Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Setting Text Node Justification in MS VBA

Status
Not open for further replies.

dkleinot

Civil/Environmental
Oct 22, 2010
7
I'm trying to place a text node in VBA and i want to set it's justification to CenterCenter. TextNodeElement.Justification is readonly...
Code:
Dim txt As TextNodeElement
txt.Justification = MsdTextJustification.msdTextJustificationCenterCenter
so i cant set it that way...
Any ideas?
Thanks
 
Replies continue below

Recommended for you

There are a few ways to accomplish this.

1. Set the active text node justification prior to creating the text node

ActiveSettings.TextStyle.NodeJustification = MsdTextJustification.msdTextJustificationCenterCenter

2. After you place the text node modify the justification on each element in the text node

Dim ee as ElementEnumerator

set ee = txt.GetSubElements
Do While ee.MoveNext
ee.Current.AsTextElement.TextStyle.Justification = MsdTextJustification.msdTextJustificationCenterCenter
Loop
 
Option 1 worked.
Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor