Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QAxObject Powerpoint

    General and Desktop
    1
    1
    2255
    Loading More Posts
    • 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.
    • A
      aniljoby last edited by

      I have the code to start, run the presentation with 3 seconds delay and to quit. These all done with a single push button click..

      QString pptFile = "C:/embedded.pptx";
          CoInitialize(NULL);
          {
              QAxObject pp("PowerPoint.Application", nullptr);
              auto presentations = pp.querySubObject("Presentations");
              auto presentation =  presentations->querySubObject("Open(QString)", pptFile);
              auto slides = presentation->querySubObject("Slides");
      
              auto sliseshowsettings = presentation->querySubObject("SlideShowSettings");
              sliseshowsettings->dynamicCall("Run()");
              auto slideshowwindow = presentation->querySubObject("SlideShowWindow");
              auto slideshowview = slideshowwindow->querySubObject("View");
      
              int numSlides = slides->property("Count").toInt();
              for(int i = 1; i < numSlides; ++i) {
                      QThread::currentThread()->sleep(3);
                      slideshowview->dynamicCall("Next()");
              }
              QThread::currentThread()->sleep(3);
              pp.dynamicCall("Quit()");
          }
          CoUninitialize();
      

      What i want to do is...
      I have five push buttons...

      1.To start Powerpoint application
      2.To start slideshow with first slide
      3.To go to next slides
      4.To go to previous slides
      5.Finally to quit

      How to to do all the above functions for the same powerpoint application..
      Please help...
      Thanks in advance

      1 Reply Last reply Reply Quote 0
      • First post
        Last post