在VSCode中预览PowerPoint

6

我使用VSCode编辑Markdown文件,有时我会在文件中添加链接到PowerPoint文件,例如[演示文稿](powerpoint.ppt)
现在,我可以使用Ctrl + 单击在VSCode中打开PowerPoint文件,但是它只显示此文件未在编辑器中显示,因为它要么是二进制文件,要么使用不支持的文本编码...
我希望能够直接在VSCode中预览PPTX文件,或找到一种简单的方式在外部应用程序中打开它。
有什么建议吗?
谢谢


我现在最好的解决方案是:
  1. 使用快捷键(Ctrl + Alt + R)“在文件资源管理器中显示” -->
  2. “Enter” 打开它并使用Powerpoint... 因此,在尝试在编辑器中打开文件后,需要两个额外的步骤。 有更好的解决方案吗?
- cyperatk
我尝试理解您在这里的问题,但我认为我可能没有正确理解。如果您有外部ppt的链接(比如Google幻灯片),那么我相信它应该像其他链接一样正常工作。您是否有本地PPT的地址,即存储在您的计算机上,并且您正在尝试从Markdown访问它? - jateen
我在VSCode中没有看到任何可以查看它的扩展,但你可以先将其转换为PDF格式,然后使用PDF查看器扩展。 - AlexApps99
这是我发现的一个扩展,我没有测试它是否可用。https://marketplace.visualstudio.com/items?itemName=yuenm18.ooxml-viewer - Torge Rosendahl
2个回答

2
据我所知,你无法直接在VSCode中打开这些文件,但是你可以使用扩展程序(如Open in External App)在另一个应用程序中打开它们(你可以通过VSCode的扩展搜索找到该扩展程序)。安装后,你可以更新你的settings.json配置:
{ 
 // [...]
"openInExternalApp.openMapper": [
        {
            // represent file extension name
            "extensionName": "pptx",
            // the external applications to open the file which extension name is html
            "apps": [
                // openCommand can be shell command or the complete executable application path
                // title will be shown in the drop list if there are several apps
                {
                    "title": "powerpoint",
                    // This will vary depending on your OS, you can also use a PPT viewer of your chosing
                    // On Windows, could be Program Files (x86) and a different version of Office, but you get the idea
                    "openCommand": "C:\\Program Files\\Microsoft Office\\root\\Office16\\powerpnt.exe"
                },
            ]
        }
    ]
}

0

Mac用户需要更改此行代码。 "openCommand": "/Applications/Microsoft powerpoint.app"


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接