Hello,
How can I call MyPowerPointShow.ppt from a vb button?
Thanks,
Gary:)
Printable View
Hello,
How can I call MyPowerPointShow.ppt from a vb button?
Thanks,
Gary:)
In the common section:
VB Code:
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
In your code
VB Code:
dim abc as long abc = Shellexecute ("c:/mypowerpointthingy.ppt", "Open", DocName, "", "C:\", SW_SHOWNORMAL)
or do a search on shellexecute
Thanks, Mendhak,
I will try that as soon as I nurse my computer back to health.
Gary
Okay, what did I do wrong?
I get an error message that says "DocName" is undefined.
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 Sub Command1_Click()
Dim abc As Long
abc = ShellExecute("c:/slidetest.ppt", "Open", DocName, "", "c\", SW_SHOWNORMAL)
End Sub