在双显示器系统中,找出 PowerPoint 幻灯片显示在哪个显示器上
在多显示器系统上运行的Powerpoint 2007/2010中,我们可以通过转到“幻灯片放映”->“幻灯片放映”来选择将在其上显示幻灯片的显示器。 “设置幻灯片”-> “显示幻灯片”并选择所需的显示器。
是否可以通过编程方式确定这些设置(例如使用VBA)?
我真正需要的是显示幻灯片的监视器的像素分辨率。 我怎样才能做到这一点?
In Powerpoint 2007/2010 run on a multiple monitor system, we can select the monitor on which the slideshow will be shown by going to "Slide Show"-> "Set up slideShow" -> "Display SlideShow on" and selecting the desired monitor.
Is it possible to programmatically determine these settings (e.g. using VBA)?
What I actually need is the pixel-resolution of the monitor on which the slideshow is shown.
How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
即使你已经接受了史蒂夫的回答。以下是一些有用的代码片段。
您可以使用此类代码获取有关系统监视器的信息(此处):
并将结果与当前
SlideShowWindows(1)
结果进行比较。Even if you already accepted Steve's answer. Here are a few useful snippets of code.
You can get info about system monitor with this kind of code (found here):
And compare the results with the current
SlideShowWindows(1)
results.试试这个:
这将为您带来分数结果。
每英寸有 72 个点,因此:
ResultInPixels = (ResultInPoints * WindowsDPI) / 72
通常 WindowsDPI 为 96,但您不能依赖于此。
对 GetSystemMetrics 的 API 调用将为您提供当前值。
Try this:
That'll give you results in points.
There are 72 points to the inch, so:
ResultInPixels = (ResultInPoints * WindowsDPI) / 72
Typically WindowsDPI is 96 but you can't rely on that.
API calls to GetSystemMetrics will give you the current value.
Edwin Vermeer 的代码 @JMax 非常棒。我确信我会被 mods 搞砸,但我制作了下图来准确显示代码中的
Sub test()
返回的内容。希望这能节省另一个 n00b 一两个小时。提示:将
Dubug.Print
查找替换为MsgBox
,并使用不同的监视器安排运行几次代码,以确保您理解返回结果。下面是一个奇怪的显示器排列赌注,它很好地展示了您将获得的不同回报:
...好吧,在我拥有 10 名声望之前它不会让我发布图片,图表在这里:
“监控”主要回报监视器
主监视器返回“工作区域”
“监视器/工作区”返回辅助监视器
(与其他 2 个在同一相册中,需要 10 声望才能发布 >2 个链接...)
The code @JMax from Edwin Vermeer is really great. I'm sure I'll get smashed by the mods for this but I made the below diagram to show exactly what
Sub test()
in the code returns. Hopefully this will save another n00b an hour or two.Tip: Find-replace
Dubug.Print
withMsgBox
and run through the code a few times with different monitor arrangements to make sure you understand the returns.The below is an odd monitor arrangement bet it demonstrates well the different returns you'll get:
...well it won't let me post pics until I have 10 reputation, diagrams are here:
"Monitor" returns for Primary monitor
"Work area" returns for Primary monitor
"Monitor/Work area" returns for Secondary monitor
(in the same album as the other 2, need 10 reputation to post >2 links...)