返回或设置一个 Boolean 类型的值,用来确定完成调查的用户名是否可见。可读写。
expression.ShowUserNamesInResults
expression 必选。返回 Survey 对象的表达式。
以下示例将当前站点上各个 Survey 对象的 ShowUserNamesInResults 属性设置为 True,并显示所有完成调查的用户名。
注意 使用 ApplyChanges 方法来保存对列表所做的更改。
Sub ChangePermissions()
'Changes permission of all BasicLists in the current web
Dim objApp As FrontPage.Application
Dim objList As Object
Dim objLists As Lists
Set objApp = FrontPage.Application
Set objLists = objApp.ActiveWeb.Lists
'Cycle through each list and check for list type
For Each objList In objLists
'If it's a Survey then change permissions
If objList.Type = fpListTypeSurvey Then
If objList.ShowUserNamesInResults <> True Then
objList.ShowUserNamesInResults = True
objList.ApplyChanges
End If
End If
Next
End Sub