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. Qt and Ms PowerPoint communication

Qt and Ms PowerPoint communication

Scheduled Pinned Locked Moved General and Desktop
ms powerpoint c
2 Posts 2 Posters 942 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.
  • A Offline
    A Offline
    aniljoby
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Please don't post the same question multiple times.

      Duplicate

      Closing this one

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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