从 VBS 中的 URL(共享点)打开 PPT [英] Open a PPT from an URL (sharepoint) in VBS
问题描述
想象一个脚本来打开一个ppt文件并导出所有幻灯片.这个脚本正是这样做的:https://github.com/docToolchain/docToolchain/blob/master/scripts/exportPPT.vbs#L44
imagine a script to open a ppt file and export all slides. This script does exactly this: https://github.com/docToolchain/docToolchain/blob/master/scripts/exportPPT.vbs#L44
我现在想扩展它以从 office365 共享链接打开 ppt 并导出幻灯片.但似乎 Presentations.Open()
方法不喜欢 URL:
I would now like to extend it to open a ppt from an office365 share-link and export the slides.
But it seems that the Presentations.Open()
method does not like URLs:
https://docs.microsoft.com/en-us/office/vba/api/powerpoint.presentations.open
...并且 Presentation.FollowHyperlink()
打开演示文稿,但我没有访问它的句柄:
...and the Presentation.FollowHyperlink()
opens the presentation, but I don't get a handle to access it:
https://docs.microsoft.com/en-us/office/vba/api/powerpoint.presentation.followhyperlink
还有什么我可以尝试的想法吗?
any further idea what I could try?
推荐答案
Presentations.Open()
适用于 URL,但您需要正确的链接格式才能使其工作.如果您使用 SharePoint复制链接"功能然后它似乎给你一个网络视图"链接不是下载"链接.
Presentations.Open()
works OK with URL's but you need the correct format of link to get it to work. If you use the SharePoint "copy link" function then it seems to give you a "web view" link not a "download" link.
它可能因您的设置而异,但对我来说,复制的链接看起来像:
It may vary according to your setup, but for me a copied link looks like:
https://myCompany.sharepoint.com/:p:/r/sites/Blah/TestLibrary/Presentation.pptx?d=56fabcc31e450arr58513f3b80886427d&csf=1&web=1&e=nQflGa
https://myCompany.sharepoint.com/:p:/r/sites/Blah/TestLibrary/Presentation.pptx?d=56fabcc31e450arr58513f3b80886427d&csf=1&web=1&e=nQflGa
去掉 URL 中的 :p:/r/
就足以在 PPT 中打开演示文稿
Removing the :p:/r/
from the URL is enough to be able to open the presentation in PPT
这篇关于从 VBS 中的 URL(共享点)打开 PPT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!