如何在 Powerpoint Slideshow Window 中查找当前幻灯片 [英] How to find current slide in Powerpoint Slideshow Window

查看:73
本文介绍了如何在 Powerpoint Slideshow Window 中查找当前幻灯片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 Powerpoint 插件,我需要找到幻灯片窗口中哪张幻灯片处于活动状态.我有这个代码:

I create a Powerpoint add-in and I need to find which slide is active in Slideshow Window. I have this code:

if (Globals.ThisAddIn.Application.SlideShowWindows.Count > 0)
{
for (int s = 0; s < Globals.ThisAddIn.Application.ActivePresentation.Slides.Count; s++)
{
//abc
}
}

所以我检查幻灯片窗口是否正在运行,然后浏览演示文稿中的所有幻灯片.但这不是很好的解决方案.我想立即获取当前幻灯片.

So I check if slideshow window is running and then go through all slides in presentation. But this is not very good solution. I want to get current slide immediately.

推荐答案

这是 VBA 来做你想做的事.它返回第一个幻灯片窗口中活动幻灯片的索引:

Here's the VBA to do what you want. It returns the index of the active slide in the first slideshow window:

SlideShowWindows(1).View.Slide.SlideIndex

这篇关于如何在 Powerpoint Slideshow Window 中查找当前幻灯片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆