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.

Sat May 03, 2014 8:39 am

I want to be able to change the font of individual characters as I iterate through the document. It's fairly easy to go through section by section and update fonts. Is it possible to go character by character?

mzrimsek
 
Posts: 1
Joined: Fri May 02, 2014 8:55 pm

Mon May 05, 2014 2:47 am

Hello,

Sorry for late reply as weekend.
Thanks for your inquiry. There is some codes for your reference.
Code: Select all
Document document = new Document();
document.LoadFromFile(filepath);
TextSelection[] text = document.FindAllString(the character, false, true);
foreach (TextSelection seletion in text)
            {
                seletion.GetAsOneRange().CharacterFormat.Font=....
            }

If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu May 08, 2014 9:12 am

Hello,

Have you tested the code provided by Gary? Did it resolve your issue?
Thanks for your feedback.

Best wishes,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc