Presentations.Open2007 method (PowerPoint)
Opens the specified presentation and provides the option to repair the presentation file. Returns a Presentation object that represents the opened presentation.
Syntax
expression. Open2007
( _FileName_
, _ReadOnly_
, _Untitled_
, _WithWindow_
, _OpenAndRepair_
)
expression A variable that represents a Presentations object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
FileName | Required | String | The name of the file to open. |
ReadOnly | Optional | MsoTriState | Specifies whether the file is opened with read/write or read-only status. |
Untitled | Optional | MsoTriState | Specifies whether the file has a title. |
WithWindow | Optional | MsoTriState | Specifies whether the file is visible. |
OpenAndRepair | Optional | MsoTriState | Specifies whether to repair the file before it is opened to prevent corruption. |
Return value
Presentation
Remarks
With the proper file converters installed, Microsoft Office PowerPoint 2003 and earlier versions open files with the following MS-DOS file name extensions: .ch3, .cht, .doc, .htm, .html, .mcw, .pot, .ppa, .pps, .ppt, .pre, .rtf, .sh3, .shw, .txt, .wk1, .wk3, .wk4, .wpd, .wpf, .wps, and .xls. PowerPoint also opens files with the following file name extensions: .docm, .docx, .mhtml, .potm, .potx, .ppam, .pptm, .pptx, .ppsm, .ppsx, .thmx, .xlsm, and .xlsx.
The ReadOnly parameter value can be one of these MsoTriState constants.
Constant | Description |
---|---|
msoFalse | The default. Opens the file with read/write status. |
msoTrue | Opens the file with read-only status. |
The Untitled parameter value can be one of these MsoTriState constants.
Constant | Description |
---|---|
msoFalse | The default. The file name automatically becomes the title of the opened presentation. |
msoTrue | Opens the file without a title. This is equivalent to creating a copy of the file. |
The WithWindow parameter value can be one of these MsoTriState constants.
Constant | Description |
---|---|
msoFalse | Hides the opened presentation. |
msoTrue | The default. Opens the file in a visible window. |
The OpenAndRepair parameter value can be one of these MsoTriState constants.
Constant | Description |
---|---|
msoFalse | Opens the specified presentation without repair. |
msoTrue | The default. Opens the specified file and repairs it. |
Example
This example opens a presentation with read-only status and repairs it.
Presentations.Open2007 FileName:="C:\My Documents\pres1.ppt", ReadOnly:=msoTrue, OpenAndRepair:=msoTrue
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.