Which code segment should you add at line 05?

You need to activate a Microsoft Office 2007 form template named SalesTemplate in a site collection. You write the following code segment:

01: Dim siteColl As New SPSite(“http://companysite”)
02: Dim services As SPServiceCollection = SPFarm.Local.Services
03: For Each service As SPService in services
04: Dim formService As FormService = DirectCast(service, formService)
05:
06: Next

Which code segment should you add at line 05?

You need to activate a Microsoft Office 2007 form template named SalesTemplate in a site collection. You write the following code segment:

01: Dim siteColl As New SPSite(“http://companysite”)
02: Dim services As SPServiceCollection = SPFarm.Local.Services
03: For Each service As SPService in services
04: Dim formService As FormService = DirectCast(service, formService)
05:
06: Next

Which code segment should you add at line 05?

A.
For Each template as FormTemplate in formService.FormTemplate
If template.Name = “SalesTemplate” Then
template.Activate
Open siteColl
Close
Exit For
End If
Next
Exit For

B.
For Each template as FormTemplate in formService.FormTemplate
If FormsService.Name = “SalesTemplate” Then
template.Activate
Open siteColl
Close
Exit For
End If
Next
Exit For

C.
Dim templates as FormTemplateCollection = FormService.FormTemplates Dim salesTemplate as new FormTemplate()
salesTemplate.Name = “SalesTemplate”
Templates.Add (“salesTemplate”)
FormService.Update()

D.
Dim templates as FormTemplateCollection = FormService.FormTemplates For Each template as FormTemplate in templates
If template.Name = “SalesTemplate” Then
template.Status = SPObjectCollection.Online
FormService.Update = True
Exit For
End If
Next



Leave a Reply 0

Your email address will not be published. Required fields are marked *