マップ ドキュメントのパスを取得する方法

 2016/9/1 (木)    

Sub templateInfo()
    Dim pTemplates As ITemplates
    Set pTemplates = Application.Templates
     
    Dim pTempCount As Long
    pTempCount = pTemplates.Count
     
    Dim i As Long
    For i = 0 To pTemplates.Count - 1
      
    Debug.Print pTemplates.Item(i)
    Next i
      
End Sub
 
Sub GetMXDPathName()
    Dim pDocument As IDocument
    Set pDocument = ThisDocument
     
    Dim pVBProject As VBProject
    Set pVBProject = pDocument.VBProject
     
    MsgBox pVBProject.FileName  'MXDファイルも含むパス名
     
    MsgBox FileSystem.CurDir    'ディレクトリ名を取得(VBA内での使用に限る)
 
End Sub

Copyright© WINGFIELD since1981 , 2018 All Rights Reserved.