PROBLEM
This is a known issue with ArcGIS 8.3 and earlier versions.
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.
Code:
Option Explicit
Sub SaveElementGeometry()
' set each element's customproperty to its current geometry
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim pGC As IGraphicsContainer
Set pGC = pMxDoc.PageLayout
pGC.Reset
Dim pElement As IElement, pElementProps As IElementProperties
Set pElement = pGC.Next
Do While Not pElement Is Nothing
Set pElementProps = pElement
pElementProps.CustomProperty = pElement.Geometry
Set pElement = pGC.Next
Loop
End Sub
Sub RestoreElementGeometry()
' sets each element's geometry to its customproperty
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim pGC As IGraphicsContainer
Set pGC = pMxDoc.PageLayout
pGC.Reset
Dim pElement As IElement, pElementProps As IElementProperties
Set pElement = pGC.Next
Do While Not pElement Is Nothing
Set pElementProps = pElement
If Not IsNull(pElementProps.CustomProperty) Then
pElement.Geometry = pElementProps.CustomProperty
End If
Set pElement = pGC.Next
Loop
Dim pAV As IActiveView
Set pAV = pMxDoc.PageLayout
pAV.Refresh
End Sub
Get help from ArcGIS experts
Download the Esri Support App