Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can I replace text in a DOCX file?
QtWS25 Last Chance

How can I replace text in a DOCX file?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt 5.15wordlibrary
7 Posts 4 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sm-a
    wrote on last edited by
    #1

    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.

    JonBJ A 2 Replies Last reply
    0
    • S sm-a

      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.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @sm-a
      There is nothing Qt for this. You won't get a suggestion for a library if you don't say say what programming language you are using. C++, Python?

      1 Reply Last reply
      3
      • C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        4
        • S sm-a

          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.

          A Offline
          A Offline
          Asperamanca
          wrote on last edited by Asperamanca
          #4

          Unless 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.

          1 Reply Last reply
          1
          • S Offline
            S Offline
            sm-a
            wrote on last edited by
            #5

            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.

            JonBJ 1 Reply Last reply
            0
            • S sm-a

              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.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @sm-a
              As you please, but doesn't running a .NET CORE application on each target platform require quite some installation/dependencies?

              S 1 Reply Last reply
              0
              • JonBJ JonB

                @sm-a
                As you please, but doesn't running a .NET CORE application on each target platform require quite some installation/dependencies?

                S Offline
                S Offline
                sm-a
                wrote on last edited by
                #7

                Yes @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.1

                Current release
                https://dotnet.microsoft.com/download/dotnet/5.0

                Note: .net CORE works with Linux, macOS und Windows.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved