新知榜官方账号
2023-12-02 02:49:13
本文介绍了使用Access打开PPT演示文档的方法。
能使用ACCESS打开PPT演示文档吗?如何操作?
使用Application对象(PowerPoint),即可解决。具体代码如下:
使用通用函数:
Function OpenPPT(sFileAsString, Optional bRunAsSlideShow As Boolean)'Designed by Daniel Pineault
Dim oPPT As Object
On Error Resume Next
Set oPPT = GetObject("PowerPoint.Application")
If Err.Number <> 0 Then
Err.Clear
Set oPPT = CreateObject("PowerPoint.Application")
End If
On Error GoTo Error_Handler
oPPT.Visible = True
oPPT.Presentations.Open(sFile) '打开对应的PPT演示文档
If bRunAsSlideShow Then
oPPT.ActivePresentation.SlideShowSettings.Run
End If
Error_Handler_Exit:
On Error Resume Next
Set oPPT = Nothing
Exit Function
Error_Handler:
MsgBox "The following error has occurred." & vbCrLf & vbCrLf & _
"Error Number: " & Err.Number & vbCrLf & _
"Error Source: OpenPPT" & vbCrLf & _
"Error Description: " & Err.Description, _
vbCritical, "An Error has Occurred!"
Resume Error_Handler_Exit
End Function
或者直接打开:
Private Sub Command0_Click()
Dim oPPT As Object
Set oPPT = CreateObject("PowerPoint.Application")
oPPT.Visible = True
oPPT.Presentations.Open "C:\Users\ZhiQiang.Li\Desktop\Arduino\程序设计基础PPT\IO口的高级应用.pptx"
End Sub
无
点击这里下载示例。
相关工具
相关文章
推荐
中国首款3A游戏上线,《黑神话:悟空》出圈!
2024-08-21 13:46
盘点15款AI配音工具,短视频配音有救了!
2024-08-12 17:11
短视频文案没创意?10大AI写作工具来帮你!
2024-08-05 16:23
Midjourney发布V6.1版本,我已分不清AI和现实了!
2024-08-01 15:03
我发现了一款国产AI绘画神器,免费易上手!
2024-07-25 16:40
7位AI考生做今年高考题,能过一本线吗?
2024-07-19 17:17
世界上第一所AI学校来了,80亿人只需要1位老师?
2024-07-18 17:12
Sora首部AI广告片上线,广告从业者危险了!
2024-06-27 13:44
OpenAI与中国说拜拜,国产AI如何接棒?
2024-06-26 15:18
人与AI会产生爱情吗,专家发话了!
2024-06-17 17:28