Phil,
Long time no hear from, here you go.
First inside ArcMap
1. Inset --> Text
2. Right click the new text element --> Properties
3. Under Size and Position Tab
4. Element Name Should be : FileName
Next Inside Microsoft Visual Basic Editor
1. Tools --> References --> Check "Microsoft Scripting Runtime"
2. Inside Project --> ArcMap Objects --> ThisDocument
3. Paste Code Below and reference AddFilePath in your code that is already written.
Code To Paste:
Public Sub AddFilePath()
Dim pApplication As Application
Dim pDocument As IDocument
Dim pMxDoc As IMxDocument
Dim pMap As IMap
Dim pLayout As IPageLayout
Dim pActiveView As IActiveView
Dim pGraphicsCont As IGraphicsContainer
Dim pElement As IElement
Dim pElementProp As IElementProperties
Dim pTextElement As ITextElement
Set pApplication = Application
Set pDocument = pApplication.Document
Set pMxDoc = ThisDocument
Set pMap = pMxDoc.Maps.Item(0) 'must be the first Data Frame in the map
Set pLayout = pMxDoc.PageLayout
Set pActiveView = pMxDoc.ActiveView
'Scroll through all elements on the layout
Set pGraphicsCont = pActiveView.GraphicsContainer
pGraphicsCont.Reset
Set pElement = pGraphicsCont.Next
Do Until pElement Is Nothing
'Check the element's name - we are looking for one called "FileName"
Set pElementProp = pElement
If pElementProp.Name = "FileName" Then
'Double-check that this is a text element
If TypeOf pElement Is ITextElement Then
'Date Last Modified
'Make Sure You Reference Microsoft Scripting Runtime or this will not work!!!!!!
Dim fso As New FileSystemObject
Dim f As File
Dim MapDocumentPath As String
MapDocumentPath = pDocument.VBProject.FileName
'Update the text to the file path of the project
Set pTextElement = pElement
Set f = fso.GetFile(MapDocumentPath)
Dim filedate As String
filedate = f.DateLastModified
'MsgBox filedate
pTextElement.Text = "Map Plotted: " & Now & ", " & "Map Edited: " & filedate & ", " & "File: " & MapDocumentPath
End If
End If
'Move on to the next graphic element
Set pElement = pGraphicsCont.Next
Loop
'Refresh the display
pActiveView.PartialRefresh esriViewGraphics, Nothing, Nothing
End Sub
Notes:
The plotted date is the current date and time, the map edited represents when the file was last modified or saved. the file is the full path to your document. Hope this helps let me know if you have any trouble, you have my email.