Project.SaveAs Method
Project Developer Reference |
Saves a file that is not the active project under a new file name.
Syntax
expression.SaveAs(Name, Format, Backup, ReadOnly, TaskInformation, Filtered, Table, UserID, DatabasePassWord, FormatID, Map, ClearBaseline, ClearActuals, ClearResourceRates, ClearFixedCosts)
expression A variable that represents a Project object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Name | Optional | String | The name of the file to save as. If Name is omitted, Project prompts for the file name. |
Format | Optional | Long | The format of the file. The FormatID argument should be used in place of Format, which is included primarily for backwards compatibility. If FormatID is specified, Format is ignored. The default value is pjMPP. Can be one of the PjFileFormat constants. |
Backup | Optional | Boolean | True if Project makes a backup copy of the file. |
ReadOnly | Optional | Boolean | True if Project should display an alert recommending that the project be opened read-only. The default value is False. |
TaskInformation | Optional | Boolean | True if task information is saved, for a project saved under a non-Project file format. False if resource information is saved. If Map is specified, TaskInformation is ignored. The default value is True if the active view is a task view and False otherwise. |
Filtered | Optional | Boolean | True if filtered tasks or resources are saved, for a project saved under a non-Project file format. False if all the tasks or resources are saved. If Map is specified, Filtered is ignored. The default value is False. |
Table | Optional | String | The name of the table containing the task or resource information, for a project saved under a non-Project format. If Map is specified, or Name specifies a database file or format, Table is ignored. The default value is the name of the active table. |
UserID | Optional | String | A user ID to use when accessing a database. If Format or FormatID is not a database, UserID is ignored. |
DatabasePassWord | Optional | String | A password to use when accessing a database. If Format or FormatID isn't a database, DatabasePassWord is ignored. |
FormatID | Optional | String | Optional String. The file or database format to use. Can be one of the following format strings:
Format StringDescription
"MSProject.mpp"Project file
"MSProject.mpt"Project template
"MSProject.mpp.9"Project 2000 - 2003 file
"MSProject.mpp.12"Project 2007 file
"MSProject.xls5"Microsoft Excel 5.0/95 (7.0) workbook
"MSProject.csv"CSV (comma delimited) file
"MSProject.txt"TXT (tab delimited) file
|
Format String | Description | ||
"MSProject.mpp" | Project file | ||
"MSProject.mpt" | Project template | ||
"MSProject.mpp.9" | Project 2000 - 2003 file | ||
"MSProject.mpp.12" | Project 2007 file | ||
"MSProject.xls5" | Microsoft Excel 5.0/95 (7.0) workbook | ||
"MSProject.csv" | CSV (comma delimited) file | ||
"MSProject.txt" | TXT (tab delimited) file | ||
Map | Optional | String | The name of the import/export map to use when exporting data. |
ClearBaseline | Optional | Boolean | True if baseline values (the Baseline Cost, Baseline Work, Baseline Start, Baseline Finish, Baseline Duration, Timephased Baseline Work, and Timephased Baseline Cost fields) are cleared when saving as a template. The default value is False. |
ClearActuals | Optional | Boolean | True if actual values (the % Complete field and, if actual costs are not calculated by Project, the Actual Cost field) are cleared when saving as a template. The default value is False. |
ClearResourceRates | Optional | Boolean | True if resource rate tables are cleared when saving as a template. The default value is False. |
ClearFixedCosts | Optional | Boolean | True if the Fixed Costs field is cleared for all tasks when saving as a template. The default value is False. |
Remarks
Use the FileSaveAs method to save the active project or to save the active project as XML.
Using the value "MSProject.mpp.9" for the FormatID parameter causes Project to show the Saving to Microsoft Office Project 2000-2003 dialog box. You can choose to keep the format or cancel the save operation. You can also check Don't tell me about this again in the dialog box.
Note |
---|
Several FormatID strings are obsolete; if you try to use them, they result in run-time error 1004. The following FormatID values can be used in Project 2003 and earlier versions but are removed in Project 2007. |
- "MSProject.mpd" shows a dialog box that states "Cannot save Project. Microsoft Office Project does not support saving projects in ODBC, MPD, or MDB formats." When you click OK, Project shows error 1004.
- "MSProject.mpw" shows error 1004.
- "MSProject.mpp.8" Shows dialog box with message, "You are trying to save a file saved in an older file format." If you click Yes to continue, Project shows error 1004.
- "MSProject.mpw"shows error 1004.
- "MSProject.odbc" shows a dialog box that states "There is an error accessing the database. The Save to Database option is not supported in this version of Microsoft Office Project. It is available in Microsoft Office Project 2003 and earlier versions. When you click OK, Project shows error 1004.
- "MSProject.mdb" shows error 1004.
- "MSProject.pivot5" Starts the Project Wizard for export, and then shows error 1004.
See Also