Outlook) (CardView.LockUserChanges 屬性

會傳回或設定 Boolean 值,指出使用者是否可以修改檢視的設定。 讀取/寫入。

語法

expression。 LockUserChanges

運算式 代表 CardView 物件的變數。

註解

如果為 True,則使用者可以修改指定檢視的設定。 然而,不會儲存介面的變更。 如果是 False (預設值),則會儲存任何變更。

範例

下列的 Visual Basic for Applications (VBA) 範例會鎖定所有使用者可用之所有檢視的使用者介面。 子常式 LockView 接受 View 物件和布 林 值,該值指出是否將鎖定 View 使用者介面。 在這個範例中,一定會以設為 True 的 Boolean 值呼叫程序。

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

另請參閱

CardView 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。