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 to convert document from Word to HTML
Forum Updated to NodeBB v4.3 + New Features

How to convert document from Word to HTML

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 385 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.
  • M Offline
    M Offline
    Mikeeeeee
    wrote on last edited by
    #1

    Hi!
    How to convert document from Word to HTML?
    Thise my code.

        QString ResumeFileName ("");
        ResumeFileName = QFileDialog::getOpenFileName(0, "Text ", "", "*.doc *.docx *.rtf");
        ResumeFileName.replace(QRegExp("[/]"), "\\");
        qDebug()<<ResumeFileName;
        if (ResumeFileName != "")
        {
            QAxObject   wordApplication("Word.Application");
            QAxObject *documents = wordApplication.querySubObject("Documents");
            QAxObject *document = documents->querySubObject("Open(const QString&, bool)", ResumeFileName, true);
            QAxObject *words = document->querySubObject("Words");
            QString TextResume;
            QString HTMLResume;
            int countWord = words->dynamicCall("Count()").toInt();
            for (int a = 1; a <= countWord; a++){
                TextResume.append(words->querySubObject("Item(int)", a)->dynamicCall("Text()").toString());
                HTMLResume.append(words->querySubObject("Item(int)", a)->dynamicCall("Text()").SomethingFfunction);
            }
            document->dynamicCall("Close (boolean)", false);
            TextResume.replace(QRegExp("[\r]"), "\r\n"); 
            qDebug()<<TextResume;
            QString Coments1 ("");
            LoadResumeInDB(TextResume, Coments1, HTMLResume);
        }
    
    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