Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 1.24 KB

Project.Project.ReadOnly.md

File metadata and controls

52 lines (36 loc) · 1.24 KB
title ms.service api_name ms.assetid ms.date ms.localizationpriority
Project.ReadOnly property (Project)
project-server
Project.Project.ReadOnly
9ec47083-afb5-b51d-96e3-c460b02f2012
06/08/2017
medium

Project.ReadOnly property (Project)

True if a project has read-only access. Read-only Boolean.

Syntax

expression.ReadOnly

expression A variable that represents a Project object.

Example

The following example copies projects with read-only access into new files with read-write access.

Sub CopyReadOnlyFiles() 
 
 Dim P As Project ' Project object used in loop 
 Dim OldName As String ' Name of project 
 Dim Path As String ' File path to project 
 Dim NewName As String ' New name of project 
 
 ' Check each open project for read-only access. 
 For Each P In Application.Projects 
 If P.ReadOnly Then ' See if project has read-only access. 
 OldName = P.Name ' Store its name. 
 Path = P.Path ' Store its path. 
 ' Create a new name for the file and save it. 
 NewName = "New " & Left(OldName, Len(OldName) - 4) & ".MPP" 
 P.Activate 
 FileSaveAs Path & PathSeparator & NewName 
 End If 
 Next P 
 
End Sub

[!includeSupport and feedback]