HOW TO
Note: The information in this article applies to ArcGIS versions 8.x only. Visual Basic for Applications (VBA) for ArcMap and ArcCatalog has been deprecated at ArcGIS 10.
Instructions provided describe how to lock features in a layout view. The code provided locks features in a layout view.
Follow the steps below.
Note: Code in the Project's 'ThisDocument' code module only runs in the current map document. To store the code in all the map documents; open the Normal.mxt ThisDocument code module instead.
Sub LockElements() Dim pDoc As IMxDocument Dim pPageLayout As IPageLayout Dim pContainer As IGraphicsContainer Dim pElement As IElement Set pDoc = ThisDocument Set pPageLayout = pDoc.PageLayout Set pContainer = pPageLayout pContainer.Reset Set pElement = pContainer.Next While Not pElement Is Nothing pElement.Locked = True Set pElement = pContainer.Next Wend End Sub
Get help from ArcGIS experts
Download the Esri Support App