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. MS Word write to field
QtWS25 Last Chance

MS Word write to field

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.9k 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.
  • 3 Offline
    3 Offline
    3lias
    wrote on last edited by
    #1

    Hello everyone
    I'm facing a problem when trying to write into a word's doc file text field.

    @
    word = new QAxWidget(this);
    word->setControl("Word.Application");
    word->dynamicCall("Visible", true );
    //how to open a file
    QAxObject* docs = word->querySubObject( "Documents" );
    QVariant filename("c:/a.docx");
    QVariant confirmconversions(false);
    QVariant readonly(false);
    QVariant addtorecentfiles(false);
    QVariant passworddocument("");
    QVariant passwordtemplate("");
    QVariant revert(false);
    QAxObject* doc = docs->querySubObject("Open(const QVariant&, const QVariant&, const QVariant&, const QVariant&, const QVariant&, const QVariant&,const QVariant&)", filename, confirmconversions, readonly, addtorecentfiles, passworddocument, passwordtemplate, revert);
    QAxObject* a = doc->querySubObject("test.Text = "Hello"");
    @

    The last line is my try to access the field.Field's name is test and the "Text" is the field's property i want to edit to insert my text.

    I would really appreciate any help cause i'm stack here for almost two weeks.

    Thank you very much
    3lias

    1 Reply Last reply
    0
    • M Offline
      M Offline
      manar_mk
      wrote on last edited by
      #2

      I'm just starting programming Qt, and here was a question about the QAxObject. How can I show it in QtextEdit or some other widget?

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        @manar_mk
        you might want to start a new thread for your question. Just start a new thread in one of the forums e.g. "General and Desktop":http://developer.qt.nokia.com/forums/viewforum/10/ or whatever suits best.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • M Offline
          M Offline
          manar_mk
          wrote on last edited by
          #4

          @koahnig Thanks...

          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