Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Jan 29, 2018 11:49 am

Hello Support,
In words: HRA355 A 22mm*25m, which are queried from DB wholly, the second 'A' should be display as special character by setting different font. How can i do?

Thank you very much.

yuqichun
 
Posts: 4
Joined: Sun Jan 28, 2018 6:45 am

Tue Jan 30, 2018 1:55 am

Hello,

Thanks for your inquiry.
Please find the "A" as a whole word first, and set the font for the text range like below.
Code: Select all
Document doc = new Document();
doc.LoadFromFile(FileName);
var textSections = doc.FindAllString("A", true, true);
foreach (var section in textSections)
{
    var range = section.GetAsOneRange();
    range.CharacterFormat.FontName = "Lucida Sans Unicode";
}
doc.SaveToFile("setFontForOneCharacter.docx");


Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Thu Feb 01, 2018 9:36 am

Hello yuqichun,

Good day!
Has your issue been resolved?
Your feedback would be greatly appreciated.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Feb 05, 2018 7:25 am

Hello Jane,

I got my issue resolved with you demo code. It did nice.

Thank you very much.
Yuqichun

yuqichun
 
Posts: 4
Joined: Sun Jan 28, 2018 6:45 am

Tue Feb 06, 2018 1:42 am

Hello yuqichun,

Thanks for your valuable feedback.
Please feel free to contact us if you need any help.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.Doc