Results 1 to 6 of 6

Thread: ActiveQt Word

  1. #1
    Join Date
    Nov 2013
    Posts
    17
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default ActiveQt Word

    Hello, how can I do this using ActiveQt?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: ActiveQt Word

    You will have to ask Microsoft how you would use their automation interface to achieve whichever bit of that page it is you want to do. Before you know how it is done without Qt you will not be able to do it with Qt.

  3. #3
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ActiveQt Word

    if you like to use word docx on qt .. yesterday a write a xslt converter....
    xmlpatterns from qt its nice to use as xslt2 or xsltproc xslt1 and can run on mac linux or window

    ActiveQt Word run only on window...

    docx is all xml based and can use as template... to write new file... docx


    https://github.com/pehohlva/qt-gmail.../docx2html.xsl

    same to odt openformat:

    https://github.com/pehohlva/qt-gmail...c/odt2html.xsl

    Qt Code:
    1. args << "xsltproc";
    2. bin_xsltproc = execlocal(QString("which"), args).simplified();
    3.  
    4. QString Document::execlocal(const QString cmd, const QStringList args) {
    5.  
    6. /// cmd is xmlpatterns or xsltproc
    7. QString debughere = cmd;
    8. int success = -1;
    9. debughere.append(" ");
    10. debughere.append(args.join(" "));
    11. console(QString("EXEC: %1").arg(debughere));
    12. QString rec;
    13. QProcess *process = new QProcess(NULL);
    14. process->setReadChannelMode(QProcess::MergedChannels);
    15. process->start(cmd, args, QIODevice::ReadOnly);
    16. //// waitForFinished default int msecs = 30000 ok
    17. if (!process->waitForFinished()) {
    18. success = -1;
    19. } else {
    20. success = 1;
    21. rec = process->readAll();
    22. }
    23. if (success == 1) {
    24. return rec;
    25. } else {
    26. return QString("ERROR: Time out by %1").arg(debughere);
    27. }
    28. }
    29.  
    30.  
    31.  
    32. if (doc_continue && !bin_xsltproc.isEmpty()) {
    33. /// convert xslt now by
    34. console(QString("Init xslt convert...%1.").arg(bin_xsltproc));
    35. QStringList xsltparam;
    36. xsltparam << "--param";
    37. xsltparam << "convert_time";
    38. xsltparam << QString("'%1'").arg(Tools::TimeNow());
    39. xsltparam << "--output";
    40. xsltparam << indexhtmlnewfile;
    41. xsltparam << worddocx2htmlstyle;
    42. xsltparam << word_document.xml; /// by unzip docx
    43. /// xslt param --param name "value"
    44. const QString errorcmd = execlocal(bin_xsltproc, xsltparam);
    45. if (errorcmd.isEmpty()) {
    46. console(QString("Xslt convert successful document..."));
    47. } else {
    48. console(QString("Xslt convert... say: %1").arg(errorcmd));
    49. }
    50. }
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Nov 2013
    Posts
    17
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: ActiveQt Word

    how use this?

  5. #5
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ActiveQt Word

    Xslt is a xml language read at http://en.wikipedia.org/wiki/XSLT and qt help to transform document
    take a word document name.docx and rename this doc to name.zip and you find inside a lot of xml and image file...
    all this you can handle und transform to other format or simple html....

    here a sample from converting docx to html

    docxconvert.jpg

    the full sample is inside a zip:
    Docx sample:
    http://freeroad.ch/archivio/convertr...ocxconvert.zip
    Pdf convert sample: without poppler only pdftohtml -xml option
    http://freeroad.ch/archivio/convertr...pdfconvert.zip
    Last edited by patrik08; 16th November 2013 at 18:33. Reason: updated contents

  6. #6
    Join Date
    Nov 2013
    Posts
    17
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: ActiveQt Word

    thank u
    &&

Similar Threads

  1. insertcaption in word using activeqt
    By ivareske in forum Qt Programming
    Replies: 0
    Last Post: 30th March 2011, 12:59
  2. how to get the word when i highlight a word with mouse?
    By saleh.hi.62 in forum Qt Programming
    Replies: 0
    Last Post: 4th July 2010, 08:24
  3. Qt {ActiveQt}
    By QTInfinity in forum Newbie
    Replies: 2
    Last Post: 26th July 2008, 08:56
  4. ActiveQt
    By sabna in forum Qt Programming
    Replies: 3
    Last Post: 7th March 2008, 08:49
  5. QT, ASP.NET and ActiveQt
    By croland in forum Qt Programming
    Replies: 1
    Last Post: 18th June 2007, 18:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.