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.

Wed Jan 26, 2011 3:12 am

I want to set the color of the header to decorate my word document. How can I do it?

tom
 
Posts: 14
Joined: Tue Nov 30, 2010 7:21 am

Wed Jan 26, 2011 9:25 am

:P In Spire.Doc, you can set the background color of the header text and the whole paragraph of the header.
To set the background color of header text, you may use the code as follows:
Code: Select all
TextRange text = headerParagraph.AppendText("header");
text.CharacterFormat.TextBackgroundColor = Color.Blue;


To set the background color of the whole header paragraph, you may use the code as follows:
Code: Select all
headerParagraph.Format.BackColor = Color.Blue;
e-iceblue support
User avatar

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

Return to Spire.Doc