M
M
Markzzz2021-03-21 16:53:56
C++ / C#
Markzzz, 2021-03-21 16:53:56

How to change font size in docx file for specific characters in c#?

In general, the task is as follows: I read a "secret message" from a txt file, then open a docx file with random text and character by character look for characters in this text that match the characters from the secret message and increase the size of these characters by some value. How can I open a Word file and go through it character by character, while changing the size of the characters? Nowhere can I find information about this, everywhere they write about paragraphs and more cumbersome constructions inside the Word.
The code is now like this:

class Program
    {
      
        static void Main(string[] args)
        {
            string path = @"C:\Users\evluc\Desktop\text.txt";
            string message = String.Concat(File.ReadAllLines(path));
            Console.WriteLine(message);
            Console.ReadKey();
        }

        static void Encrypt(string message)
        {
            for (int i = 0; i < message.Length; i++)
            {

            }
        }
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-03-21
@vabka

1.docx is not a text format, so it will be a bit non-trivial.
2.Office OpenXML

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question