请问如何用VB调用现有的PowerPoint文件

dingguangwen 2003-10-17 10:22:52
也就是如何使用VB来打开现有的一个PowerPoint文件?
...全文
51 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
withpointer 2003-10-17
  • 打赏
  • 举报
回复
同意使用ShellExecute,不过别忘了声明!
vbanddelphi 2003-10-17
  • 打赏
  • 举报
回复
方法一:
调用两个API函数“shellexecute"和"getdesktopwindow"
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Declare Function GetDesktopWindow Lib "user32" () As Long

Private Const SW_SHOWMAXIMIZED = 3



Private Sub Command1_Click()
Dim pat
pat = "c:\1.ppt" '假设是你所放文件的路径
ShellExecute GetDesktopWindow(), "open", pat, pat, "C:\", SW_SHOWMAXIMIZED

方法二:
在”工程\应用\"里面直接应用相应的可插入对象也可以!
End Sub

射天狼 2003-10-17
  • 打赏
  • 举报
回复
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub Command1_Click()
On Error GoTo Errhandle
ShellExecute Me.hwnd, "open", "C:\aa.ppt", vbNullString, vbNullString, 1
Exit Sub

Errhandle:
MsgBox Err.Description & "!", vbInformation
End Sub

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧