totn Access

MS Access 2003: Open a PowerPoint file from a macro

This MSAccess tutorial explains how to open a PowerPoint file from a macro in Access 2003 (with screenshots and step-by-step instructions).

Question: How can I open a PowerPoint file from Access 2003/XP/2000/97 using a macro?

Answer: First, you need to create a custom function.

Open your Access database, click on the Modules tab and create a new Module. Paste in the following code:

Function OpenPPTFile() As Boolean

   Dim stAppName As String

   stAppName = "C:\Program Files\Microsoft Office\Office\Powerpnt.exe C:\Presentation1.ppt"
   Call Shell(stAppName, 1)

   OpenPPTFile = True

End Function

In this example, C:\Program Files\Microsoft Office\Office\Powerpnt.exe is the path to the PowerPoint application and C:\Presentation1.ppt is the presentation that you wish to open.

You will need to customize these to match your files/directories.

Next, create a Macro and select "RunCode" from the drop-down. Then enter OpenPPTFile() as the Function Name to call.

Microsoft Access