+ Reply to Thread
Results 1 to 2 of 2

Open PowerPoint program

Hybrid View

Launchnet Open PowerPoint program 03-09-2009, 03:55 PM
Leith Ross Re: Open PowerPoint program 03-09-2009, 04:42 PM
  1. #1
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Open PowerPoint program

    Is there a way to open PowerPoint .ppt using a macro.

    Additionally, I also need to beable to open videos that end in .wmv and/or .mov and/or .avi
    Last edited by Launchnet; 03-09-2009 at 09:46 PM.
    Thanks for helping . . .
    Matt @ Launchnet

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Open PowerPoint program

    Hello Matt,

    Here is a macro that will run a program based on its file extension. Place this code in a standard VBA module. Change the file name and file path to match the program you want to open and run.
     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
    
    
    Sub RunProgram()
    
      Dim FilePath As String
      Dim RetVal As Long
      
      Filename = "Test File.mpg"
      FilePath = "C:\Documents and Settings\Owner\My Documents\"
      
        RetVal = ShellExecute(0&, "open", Filename, "", FilePath, 1&)
      
    End Sub
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1