HOW TO
This code sample shows how to make a list of all the predefined datums available in ArcGIS using Visual Basic for Applications and ArcObjects.
Note:
Code in the project's ThisDocument code module will only run in the current map document. If you want to store the code in all your map documents, open the Normal.mxt ThisDocument code module instead.
Code:
Sub ListDatums()
Dim pSRFactory As ISpatialReferenceFactory
Set pSRFactory = New SpatialReferenceEnvironment
Dim pDatumList As ISet
Set pDatumList = pSRFactory.CreatePredefinedDatums
'Get a list of the predefined datums.
Dim pDatum As IDatum
Set pDatum = pDatumList.Next
Do Until pDatum Is Nothing
Debug.Print pDatum.Name
Debug.Print pDatum.FactoryCode
Set pDatum = pDatumList.Next
Loop
End Sub
Get help from ArcGIS experts
Download the Esri Support App