How can I replace text in a DOCX file?
-
wrote on 10 Jan 2021, 22:58 last edited by
I am new to Qt and hope I get an answer.
How can I replace text in a DOCX file? What library do I need. Best would be free (library). If possible give me an example to see how the library works.Thank you for help.
-
I am new to Qt and hope I get an answer.
How can I replace text in a DOCX file? What library do I need. Best would be free (library). If possible give me an example to see how the library works.Thank you for help.
-
wrote on 11 Jan 2021, 08:17 last edited by
If your application is running on a machine with Microsoft Word installed then you can automate it with ActiveQt.
Depending on the the complexity of the task you could unzip the DOCX file, modify the word/document.xml file it contains, and then zip up the result.
-
I am new to Qt and hope I get an answer.
How can I replace text in a DOCX file? What library do I need. Best would be free (library). If possible give me an example to see how the library works.Thank you for help.
wrote on 11 Jan 2021, 12:40 last edited by Asperamanca 1 Nov 2021, 12:40Unless you have other reasons to use Qt for this, I would consider using .NET. The library support for something like this should be much better there.
-
wrote on 13 Jan 2021, 16:32 last edited by
I use C++ as programming language. The application must be platform independent.
The solution for me is to write a .NET CORE application with the "DocumentFormat.OpenXml" library which is platform independent. Then I simply run this application under each platform to replace text.
Thanks for your help.
-
I use C++ as programming language. The application must be platform independent.
The solution for me is to write a .NET CORE application with the "DocumentFormat.OpenXml" library which is platform independent. Then I simply run this application under each platform to replace text.
Thanks for your help.
-
@sm-a
As you please, but doesn't running a .NET CORE application on each target platform require quite some installation/dependencies?wrote on 13 Jan 2021, 20:06 last edited byYes @JonB, it requires depencencies but this is not a problem. I will install this automaticly after users choice.
You can find them under:
LTS RELEASE
https://dotnet.microsoft.com/download/dotnet-core/3.1Current release
https://dotnet.microsoft.com/download/dotnet/5.0Note: .net CORE works with Linux, macOS und Windows.
1/7