Andrea Francia
Andrea Francia

Reputation: 9997

How to (programmatically) figure out the path of the current ArcMap document with VBA

I would like a Visual Basic for Application Function which shows the path of the current document.

For example if ArcMap is displaying map.mxd I need to display its path.

I found only some examples for querying the path of the datasources of the displayed layers.

Upvotes: 1

Views: 1787

Answers (1)

cfern
cfern

Reputation: 6006

Use this:

Dim DocAbsPath As String
DocAbsPath = Application.Templates.Item(Application.Templates.Count - 1)

Taken from this thread.

Upvotes: 2

Related Questions