Compartir a través de


Propiedad Resource.Group (Project)

Obtiene o establece el grupo al cual pertenece un recurso. String de lectura y escritura.

Sintaxis

expresión. Grupo

Expresión Variable que representa un objeto Resource .

Ejemplo:

En el siguiente ejemplo, se eliminan los recursos del proyecto activo que pertenecen a un grupo especificado por el usuario.

Sub DeleteResourcesInGroup() 
 
 Dim Entry As String ' The group specified by the user 
 Dim Deletions As Integer ' The number of deleted resources 
 Dim R As Resource ' The resource object used in loop 
 
 ' Prompt user for the name of a group. 
 Entry = InputBox$("Enter a group name:") 
 
 ' Cycle through the resources of the active project. 
 For Each R in ActiveProject.Resources 
 ' Delete a resource if its group name matches the user's request. 
 If R.Group = Entry Then 
 R.Delete 
 Deletions = Deletions + 1 
 End If 
 Next R 
 
 ' Display the number of resources that were deleted. 
 MsgBox(Deletions & " resources were deleted.") 
 
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.