Compartir a través de


Propiedad Subproject.ReadOnly (Project)

True si los cambios en el subproyecto afectan a su proyecto principal. Boolean de lectura y escritura.

Sintaxis

expresión. ReadOnly

expresión Variable que representa un objeto Subproject .

Ejemplo

En el ejemplo siguiente se copian proyectos con acceso de sólo lectura en archivos nuevos con acceso de lectura y escritura.

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

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.