Hi Jeff,
Thanks for the reply, I'm still getting this error though. I've even tried starting afresh. Currently all i'm trying to achieve is the creation of a button add-in that displays a form containing some details about the currently open map document.
My code is:
Public Class MxdDetailsCreator
Inherits ESRI.ArcGIS.Desktop.AddIns.Button
Public Sub New()
End Sub
Protected Overrides Sub OnClick()
Dim testfrm = New frmMxdData
testfrm.Show()
My.ArcMap.Application.CurrentTool = Nothing
End Sub
Protected Overrides Sub OnUpdate()
Enabled = My.ArcMap.Application IsNot Nothing
End Sub
End Class
Code for the windows form:
Imports ESRI.ArcGIS.ArcMap
Imports ESRI.ArcGIS.esriSystem
Imports ESRI.ArcGIS.ArcMapUI
Imports ESRI.ArcGIS.Framework
Imports ESRI.ArcGIS.SystemUI
Imports ESRI.ArcGIS.Desktop
Public Class frmMxdData
Private Sub frmMxdData_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim pmxDocument As IMxDocument
pmxDocument = My.ArcMap.Document
Dim pIdoc As IDocument
pIdoc = pmxDocument
tbMapTitle.Text = (pIdoc.Title) 'Populate text box with map title
End Sub
End Class
The error:
Error 3 'IDocument' is not accessible in this context because it is 'Friend'.
Intellisense gives me the IDocument option, but as soon as it is entered into the code it is flagged as an error irrespective of the method I use to get to it.
Thanks,
Sam