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. Creating and adding values to Chart in Word C++ ActiveQT
Forum Updated to NodeBB v4.3 + New Features

Creating and adding values to Chart in Word C++ ActiveQT

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

    Hello everybody,

    I need add a chart to my word document with some custom values for the chart, what I have managed to do is only add a new chart where the excel spreadsheet pop up and and add that into my document, but the problem is that I want to add those values programmatically, I searched almost everything and couldn't find!
    Can any of you help?
    The code is as below:
    @
    QString outFile("D:\output.docx");
    QString inFile1("D:\input.docx");
    QAxObject axObject("Word.Application");
    QAxObject* documents = axObject.querySubObject("Documents");
    QAxObject* document = documents->querySubObject("Open(const QString&, bool)", inFile1, true);
    QAxObject* shapes = document->querySubObject("InlineShapes");
    QAxObject* chart = shapes->querySubObject("AddChart(int)", 74, 100, 100, 500, 800);
    document->dynamicCall("SaveAs(const QString&)", outFile);
    document->dynamicCall("Close()");
    axObject.dynamicCall("Quit()");
    @

    Thanks in advance

    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