AddTemplate Method
Description
Creates a new security permissions template using the Microsoft Office Project Server 2003 security object.
Syntax
Function AddTemplate( _
ByVal bstrTemplateName As String, _
ByVal bstrTemplateDesc As String, _
Optional ByVal lCopyTemplateID As Long = 0 _
) As Long
Parameters
Parameter | Description |
---|---|
bstrTemplateName |
Required String. Name of the new template. |
bstrTemplateDesc |
Required String. Description of the new template. |
lCopyTemplateID |
Optional Long. Specifies the template ID on which to base the new template. The template ID is from MSP_WEB_SECURITY_TEMPLATES.WSEC_TMPL_ID. |
Return Value
The AddTemplate method returns HRESULT as a Long (4-byte integer) value.
Remarks
For information on how Project Server uses AddTemplate, see admin/sec_svr_templates.asp and ModifyTemplate Function.
Example
The following Microsoft Visual Basic 6.0 example creates a new template based on the existing template ID 4 (Project Manager).
Dim lResult as Long
Set oSec = CreateObject("PjSvrSecurity.PjSvrSecurity")
oSec.SetDBConnection "ProjectServer"
lResult = oSec.AddTemplate("Template name", "Template description", 4)
Set oSec = Nothing