共用方式為


BusinessCardView.LockUserChanges Property (Outlook)

Returns or sets a Boolean value that indicates whether a user can modify the settings of the current view. Read/write.

Version Information

Version Added: Outlook 2007

Syntax

expression .LockUserChanges

expression An expression that returns a BusinessCardView object.

Remarks

If True, the user can modify the settings of the current view. However, changes made to the interface will not be saved. If False (the default), any changes will be saved.

Example

The following Visual Basic for Applications (VBA) example locks the user interface for all views that are available to all users. The subroutine LockView accepts the View object and a Boolean value that indicates if the View user interface will be locked. In this example the procedure is always called with the Boolean value set to 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 
 

See Also

Concepts

BusinessCardView Object

BusinessCardView Object Members