Outlook) (TableView.SaveOption 属性

返回一个 OlViewSaveOption 常量,用于指定在其中指定的视图是可用的文件夹和视图的读取的权限。 只读。

语法

expression。 SaveOption

表达式 表示 TableView 对象的变量。

备注

使用 视图 集合的 Add 方法创建 表 对象时设置 SaveOption 属性的值。

示例

下面的 Visual Basic for Applications (VBA) 示例锁定对所有用户可用的全部视图的用户界面。 该子例程 LockView 接受 View 对象和一个 布尔 值,该值指示是否将锁定 View 用户界面。 在此示例中,将设置为 True 的 布尔 值与始终调用的过程。

Sub LockPublicViews() 
 
 
 
 Dim objName As NameSpace 
 
 Dim objViews As Views 
 
 Dim objView As View 
 
 
 
 ' Get the Views collection for the Contacts default folder. 
 
 Set objName = Application.GetNamespace("MAPI") 
 
 Set objViews = objName.GetDefaultFolder(olFolderContacts).Views 
 
 
 
 ' Enumerate the Views collection and lock the user 
 
 ' interface for any view that can be accessed by 
 
 ' all users who have access to the Notes default folder. 
 
 For Each objView In objViews 
 
 If objView.SaveOption = _ 
 
 olViewSaveOptionThisFolderEveryone Then 
 
 
 
 Call LockView(objView, True) 
 
 End If 
 
 Next objView 
 
 
 
End Sub 
 
 
 
Sub LockView(ByRef objView As View, ByVal blnAns As Boolean) 
 
 
 
 ' Examine the view object. 
 
 With objView 
 
 If blnAns = True Then 
 
 ' Lock the user interface and 
 
 ' save the view 
 
 .LockUserChanges = True 
 
 .Save 
 
 Else 
 
 ' Unlock the user interface of the view. 
 
 .LockUserChanges = False 
 
 End If 
 
 End With 
 
 
 
End Sub

另请参阅

表对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。