And being the VB/A junkie that I am, I/we use this to lock all viewports within the current drawing.
Public Sub LockAllVPorts()
Dim oLayout As AcadLayout
Dim oEnt As AcadEntity
With ThisDrawing
For Each oLayout In .Layouts
If Not oLayout Is .ModelSpace Then
For Each oEnt In oLayout.Block
If TypeOf oEnt Is AcadPViewport Then
oEnt.DisplayLocked = True
End If
Next oEnt
End If
Next oLayout
End With
ThisDrawing.Utility.Prompt vbCrLf & " Viewport locking complete!"
End Sub