Skip to content

Commit 03bb730

Browse files
[all hosts] Get latest (#2438)
1 parent 0c36477 commit 03bb730

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

docs/docs-ref-autogen/powerpoint/powerpoint/powerpoint.presentation.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,35 @@ methods:
272272
ONLY)](/javascript/api/requirement-sets/powerpoint/powerpoint-api-requirement-sets)
273273
\]
274274
275+
276+
#### Examples
277+
278+
279+
```TypeScript
280+
281+
// Link to full sample:
282+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/preview-apis/presentation-get-active-slide.yaml
283+
284+
285+
await PowerPoint.run(async (context) => {
286+
// Gets the active slide in the presentation.
287+
const slide: PowerPoint.Slide = context.presentation.getActiveSlideOrNullObject();
288+
slide.load("id");
289+
const activeSlideImage = slide.getImageAsBase64({ height: 200 });
290+
await context.sync();
291+
292+
if (slide.isNullObject) {
293+
console.log("There are no slides in this presentation.");
294+
return;
295+
}
296+
297+
console.log(`Active slide ID: ${slide.id}`);
298+
299+
updateSlideImage(activeSlideImage.value);
300+
});
301+
302+
```
303+
275304
isPreview: true
276305
isDeprecated: false
277306
syntax:

generate-docs/API Coverage Report.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10585,7 +10585,7 @@ powerpoint,PowerPoint.Presentation,"slideMasters",Property,Great,false
1058510585
powerpoint,PowerPoint.Presentation,"slides",Property,Good,false
1058610586
powerpoint,PowerPoint.Presentation,"tags",Property,Good,false
1058710587
powerpoint,PowerPoint.Presentation,"title",Property,Fine,false
10588-
powerpoint,PowerPoint.Presentation,"getActiveSlideOrNullObject()",Method,Excellent,false
10588+
powerpoint,PowerPoint.Presentation,"getActiveSlideOrNullObject()",Method,Excellent,true
1058910589
powerpoint,PowerPoint.Presentation,"getSelectedShapes()",Method,Great,true
1059010590
powerpoint,PowerPoint.Presentation,"getSelectedSlides()",Method,Great,true
1059110591
powerpoint,PowerPoint.Presentation,"getSelectedTextRange()",Method,Excellent,true

generate-docs/script-inputs/script-lab-snippets.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16750,6 +16750,28 @@ PowerPoint.Presentation:class:
1675016750
presentation.insertSlidesFromBase64(chosenFileBase64, insertOptions);
1675116751
await context.sync();
1675216752
});
16753+
PowerPoint.Presentation#getActiveSlideOrNullObject:member(1):
16754+
- >-
16755+
// Link to full sample:
16756+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/preview-apis/presentation-get-active-slide.yaml
16757+
16758+
16759+
await PowerPoint.run(async (context) => {
16760+
// Gets the active slide in the presentation.
16761+
const slide: PowerPoint.Slide = context.presentation.getActiveSlideOrNullObject();
16762+
slide.load("id");
16763+
const activeSlideImage = slide.getImageAsBase64({ height: 200 });
16764+
await context.sync();
16765+
16766+
if (slide.isNullObject) {
16767+
console.log("There are no slides in this presentation.");
16768+
return;
16769+
}
16770+
16771+
console.log(`Active slide ID: ${slide.id}`);
16772+
16773+
updateSlideImage(activeSlideImage.value);
16774+
});
1675316775
PowerPoint.Presentation#getSelectedShapes:member(1):
1675416776
- >-
1675516777
// Link to full sample:

0 commit comments

Comments
 (0)