Color plays important roles in articles. It can help you emphasize your message and guide your audience. Color can simply help your readers distinguish which part in your article is important. It will influence the way that your audience perceitive your message. And color can make your article with a nice freindly appearance.
Microsoft Word comes with a number of functions for users to set Word TEXT color. But without Microsoft Word, you also can customize Word TEXT color through C#/VB.NET. C# (pronounced “see sharp”) is one of the programming languages designed for the Common Language Infrastructure. It is a multi-paradigm programming language encompassing imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines. C# through Spire.Doc for .NET can easily help you set Word TEXT color.
Spire.Doc for .NET, is a C#/.NET word component which enables .NET applications to read, modify and write Word documents without Microsoft Word to be installed on the Server. Spire.Doc for .NET can help you use C# set color at your will. You can C# color in Word background, C# color in Word TEXT and C# color in Word hyperlinks. Besides setting word color, Spire.Doc for .NET also can help you convert/export Word document to PDF/RTF, convert DOC to HTML, DOC to TEXT, etc. Furthermore, it allows users to insert bookmarks, text/picture watermark, formatted text, paragraph, images into Word Document. For more information about Spire.Doc for .NET, please click here.
Demo C# Codes of Spire.Doc for .NET to set font and color in Word Document:
using System.Drawing;
using Spire.Doc;
using Spire.Doc.Documents;
namespace Encrypt
{
class Program
{
static void Main(string[] args)
{
//Create word document
Document document = new Document();
//Create a section
Section section = document.AddSection();
//Define ParagraphStyle class
ParagraphStyle style = new ParagraphStyle(document);
style.Name = "red";
style.CharacterFormat.TextColor = Color.Red;
document.Styles.Add(style);
//Create a paragraph
Paragraph paragraph1 = section.AddParagraph();
//Append text to paragraph1
paragraph1.AppendText("The demo demonstrates how to set word color");
//Create a second paragraph
Paragraph paragraph2 = section.AddParagraph();
//Append text to paragraph2
paragraph2.AppendText("red text");
//Append text to the text of paragraph2
paragraph2.ApplyStyle(style.Name);
//Save the file
document.SaveToFile("Sample.doc");
}
}
}
Microsoft Word comes with a number of functions for users to set Word TEXT color. But without Microsoft Word, you also can customize Word TEXT color through C#/VB.NET. C# (pronounced “see sharp”) is one of the programming languages designed for the Common Language Infrastructure. It is a multi-paradigm programming language encompassing imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines. C# through Spire.Doc for .NET can easily help you set Word TEXT color.
Spire.Doc for .NET, is a C#/.NET word component which enables .NET applications to read, modify and write Word documents without Microsoft Word to be installed on the Server. Spire.Doc for .NET can help you use C# set color at your will. You can C# color in Word background, C# color in Word TEXT and C# color in Word hyperlinks. Besides setting word color, Spire.Doc for .NET also can help you convert/export Word document to PDF/RTF, convert DOC to HTML, DOC to TEXT, etc. Furthermore, it allows users to insert bookmarks, text/picture watermark, formatted text, paragraph, images into Word Document. For more information about Spire.Doc for .NET, please click here.
Demo C# Codes of Spire.Doc for .NET to set font and color in Word Document:
using System.Drawing;
using Spire.Doc;
using Spire.Doc.Documents;
namespace Encrypt
{
class Program
{
static void Main(string[] args)
{
//Create word document
Document document = new Document();
//Create a section
Section section = document.AddSection();
//Define ParagraphStyle class
ParagraphStyle style = new ParagraphStyle(document);
style.Name = "red";
style.CharacterFormat.TextColor = Color.Red;
document.Styles.Add(style);
//Create a paragraph
Paragraph paragraph1 = section.AddParagraph();
//Append text to paragraph1
paragraph1.AppendText("The demo demonstrates how to set word color");
//Create a second paragraph
Paragraph paragraph2 = section.AddParagraph();
//Append text to paragraph2
paragraph2.AppendText("red text");
//Append text to the text of paragraph2
paragraph2.ApplyStyle(style.Name);
//Save the file
document.SaveToFile("Sample.doc");
}
}
}