Coder Social home page Coder Social logo

Comments (4)

EsterBergen avatar EsterBergen commented on August 10, 2024

HI @Jayshiv1408Dev - have you tried this? https://learn.microsoft.com/en-us/office/dev/add-ins/powerpoint/powerpoint-add-ins#navigate-to-a-particular-slide-in-the-presentation

from office-js.

Jayshiv1408Dev avatar Jayshiv1408Dev commented on August 10, 2024

Thanks @EsterBergen I'll try this.
https://learn.microsoft.com/en-us/javascript/api/office/office.document?view=common-js-preview#office-office-document-getselecteddataasync-member(1)
image
I check that earlier it's showing in preview stage.

from office-js.

Jayshiv1408Dev avatar Jayshiv1408Dev commented on August 10, 2024

HI @Jayshiv1408Dev - have you tried this? https://learn.microsoft.com/en-us/office/dev/add-ins/powerpoint/powerpoint-add-ins#navigate-to-a-particular-slide-in-the-presentation

I tried but it's not Redirecting.
Here is my code snippet.
If I'm making some mistake please let me know.

Here is my CDN
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript"></script>

async function makeSlideActive1(slideIndex) {
    var Globals = { activeViewHandler: 0, firstSlideId: 0 }
    PowerPoint.run(async context => {
        const presentation = context.presentation;
        const slides = presentation.slides;

        slides.load("items");
        await context.sync();

        if (slideIndex < 0 || slideIndex >= slides.items.length) {
            console.error("Slide index out of range.");
            return;
        }
        const slideId = slides.items[slideIndex].id;
        Globals.firstSlideId = slideId;
        Office.context.document.getSelectedDataAsync(Office.CoercionType.SlideRange, function (asyncResult) {
            if (asyncResult.status == "failed") {
                app.showNotification("Action failed with error: " + asyncResult.error.message);
            }
            else {
                Globals.firstSlideId = slideId;
                app.showNotification(JSON.stringify(asyncResult.value));
            }
        });
    });
}

from office-js.

EsterBergen avatar EsterBergen commented on August 10, 2024

It should work if you follow this guidance @Jayshiv1408Dev .

https://learn.microsoft.com/en-us/office/dev/add-ins/powerpoint/powerpoint-add-ins#navigate-to-a-particular-slide-in-the-presentation

from office-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.