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 JAE 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
Joined
Oct 22, 2010
Messages
7
Location
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
 
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

Back
Top