空間参照のエクスポート

'ThisDocumentの取得
Dim pMxDocument As IMxDocument
Set pMxDocument = ThisDocument

'アクティブなデータフレームの取得
Dim pMap As IMap
Set pMap = pMxDocument.FocusMap

'空間参照オブジェクトの取得
Dim pESRISpatialReference As IESRISpatialReference
Set pESRISpatialReference = pMap.SpatialReference

Dim pBytes As Long
Dim pBuffer As String * 512    '変数領域を確保しないとクラッシュする

pESRISpatialReference.ExportToESRISpatialReference pBuffer, pBytes

Debug.Print pESRISpatialReference.ESRISpatialReferenceSize
Debug.Print pBuffer
Debug.Print pBytes