How to Insert color text into document?

Dear support,
I use aspose.words.dll v18.7 based on VB.net 2008 to insert color text into any position of a main document, such as insert it into the head/end or after/before a given paragraph, unfortunately, the dll always output wrong result, the color text in the output file always display as black text. How to fix this? or how to reach my goal?
Following is my codes:

Dim Doc =  new Document(sFile)
Dim Builder =new DocumentBuilder(Doc )
        builder.Font.Size = 12  'Set fontsize of inserted color text
        builder.Font.Color = Color.Red 'Set the color of inserted text
        builder.MoveToParagraph(10, 0)     'Insert the color text into the 10th parargraph
        builder.Write("This text in red color font will be inserted") 

Doc.save(OutFile)
'The dll output wrong result, the color of the inserted text is the color of the main document, not the set color red. And the fontsize of inserted text is not 12 but that of the main document.

Could you help me to fix this?

Thanks for your help!

Ducaisoft


@ducaisoft,

Please upgrade to the latest version of Aspose.Words for .NET i.e. 19.10 and use the following simple code to get the desired output:

Document doc = new Document("E:\\Temp\\in.doc");
DocumentBuilder builder = new DocumentBuilder(doc);

builder.MoveToParagraph(1, 0);     // Insert the color text into the 10th parargraph

builder.Font.Size = 12;  // Set fontsize of inserted color text
builder.Font.Color = Color.Red; //Set the color of inserted text

builder.Write("This text in red color font will be inserted");

doc.Save("E:\\Temp\\19.10.docx");

P.S. You can easily convert the above C# code to VB.NET yourself by using some converter. For example: Convert C# to VB.NET - A free code conversion tool - developer Fusion