Results 1 to 3 of 3

Thread: Cannot open XML files processed with QDomDocument using Microsoft Word

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Cannot open XML files processed with QDomDocument using Microsoft Word

    After processing XML files with QDomDocument and saving them like this:
    Qt Code:
    1. if(fileName!=""){
    2. QFile file(fileName);
    3. if(!file.open(QIODevice::WriteOnly)){
    4. QMessageBox::critical(this,tr("Error"),tr("Could not open file"));
    5. }else{
    6. QTextStream stream(&file);
    7. QString fdt=FDTemplate->toString();
    8. fdt.toStdString();
    9. stream<<fdt;
    10. stream.flush();
    11. file.close();
    12. }
    To copy to clipboard, switch view to plain text mode 
    the files cannot be opened using Word or FrameMaker. Frame maker error is "Invalid byte"(funky signs)" of a -byte sequence". Does anyone know
    what is going on? The files look fine when i open them with NotePad and NotePad++...

    I read somewhere that this might be casued by QString and I've tried to convert it to std::string using .toStdString() before sending to QTextStream, but that did no help.
    Last edited by Bodizo; 30th December 2011 at 13:21.

Similar Threads

  1. Open Microsoft excel files in QT --linux
    By qixier in forum Qt Programming
    Replies: 1
    Last Post: 2nd June 2010, 09:58
  2. Open Ms Word, Ms excel, ppt files in QT -Linux
    By amankamboj1 in forum Qt Programming
    Replies: 3
    Last Post: 5th September 2009, 08:55
  3. Getting Microsoft Word Object to SaveAs
    By jvwebb in forum Newbie
    Replies: 3
    Last Post: 2nd September 2008, 19:27
  4. invoking microsoft word from qt
    By omprakash in forum Qt Programming
    Replies: 2
    Last Post: 31st October 2007, 20:43

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.