Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Setting Text Node Justification in MS VBA

Status
Not open for further replies.

dkleinot

Civil/Environmental
Oct 22, 2010
7
0
0
US
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
 
Status
Not open for further replies.
Back
Top