Método Application.GetProjectServerVersion (Project)
Este método comprueba la versión de Project Server del proyecto activo. También puede usarse para comprobar si la dirección URL de un servidor determinado hace referencia a un servidor de Project Server válido y en funcionamiento.
Sintaxis
expresión. GetProjectServerVersion
( _ServerURL_
)
expresión Variable que representa un objeto Application.
Parámetros
Nombre | Obligatorio/opcional | Tipo de datos | Descripción |
---|---|---|---|
ServerURL | Obligatorio | String | Cadena que representa la dirección URL del servidor de Project Server cuya versión se va a comprobar. |
Valor devuelto
PjServerVersionInfo
Comentarios
Si el argumento ServerURL no hace referencia a un servidor de Project Server válido y en funcionamiento, el método devuelve un error capturable (código de error 1004).
Ejemplo:
En el siguiente ejemplo se devuelve una secuencia XML que representa la siguiente configuración de Project Server: ProjectServerSettingsRequest, AdminDefaultTrackingMethod, AdminTrackingLocked, ProjectIDInProjectServer, ProjectManagerHasTransactions, ProjectManagerHasTransactionsForCurrentProject, TimePeriodGranularity y GroupsForCurrentProjectManager.
Sub mpsVersion()
URL = ActiveProject.ServerURL
If Application.GetProjectServerVersion(URL) = pjServerVersionInfo_P10 Then
ActiveProject.MakeServerURLTrusted
xmlStream = Application.GetProjectServerSettings( _
RequestXML:="<ProjectServerSettingsRequest>" _
& "<AdminDefaultTrackingMethod /><AdminTrackingLocked />" _
& "<ProjectIDInProjectServer />" _
& "<ProjectManagerHasTransactions />" _
& "<ProjectManagerHasTransactionsForCurrentProject />" _
& "<TimePeriodGranularity /><GroupsForCurrentProjectManager />" _
& "</ProjectServerSettingsRequest>")
MsgBox xmlStream
Else
MsgBox "This macro returns information from Project " _
& "Server. Please choose 'Collaborate using Project " _
& "Server' and specify a valid Project Server URL " _
& "for this project in Collaboration Options (Collaborate menu)."
Exit Sub
End If
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.