Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files from any .NET platform (C#, VB.NET, ASP.NET, .NET Core) and Java applications (J2SE and J2EE) with fast and high quality performance.

Mon Jan 10, 2011 4:56 am

Can I align Word text with Spire.DOC?
What formats does it supports?

Posts: 7
Joined: Tue Dec 21, 2010 9:01 am

Tue Jan 11, 2011 1:47 am

Yes, you can. The Spire.DOC supports align left, align right, align center and justify. If you want to you can follow the source codes below:
paragraph1.Format.HorizontalAlignment = HorizontalAlignment.Left.
This will make the text to align left.
paragraph2.Format.HorizontalAlignment = HorizontalAlignment.Center.
This will make the text to align center.
paragraph3.Format.HorizontalAlignment = HorizontalAlignment.Right.
This will make the text to align right.
paragraph4.Format.HorizontalAlignment = HorizontalAlignment.Justify.
This will make the text to justify.
e-iceblue support
User avatar

iceblue support
Posts: 240
Joined: Tue Dec 21, 2010 2:56 am

Return to Spire.Doc