Results 1 to 4 of 4

Thread: How can I call MyPowerPointShow.ppt from a vb button?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2002
    Location
    Tennessee
    Posts
    378

    How can I call MyPowerPointShow.ppt from a vb button?

    Hello,

    How can I call MyPowerPointShow.ppt from a vb button?



    Thanks,
    Gary
    Thanks,
    GARY

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Shouldn't this be in the General VB forum?

    In the common section:

    VB Code:
    1. Private Declare Function ShellExecute Lib _
    2.     "shell32.dll" Alias "ShellExecuteA" _
    3.     (ByVal hwnd As Long, _
    4.     ByVal lpOperation As String, _
    5.     ByVal lpFile As String, _
    6.     ByVal lpParameters As String, _
    7.     ByVal lpDirectory As String, _
    8.     ByVal nShowCmd As Long) As Long

    In your code

    VB Code:
    1. dim abc as long
    2. abc = Shellexecute ("c:/mypowerpointthingy.ppt", "Open", DocName, "", "C:\", SW_SHOWNORMAL)

    or do a search on shellexecute

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2002
    Location
    Tennessee
    Posts
    378
    Thanks, Mendhak,

    I will try that as soon as I nurse my computer back to health.

    Gary
    Thanks,
    GARY

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2002
    Location
    Tennessee
    Posts
    378
    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
    Thanks,
    GARY

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width