Hello,
Try this code, I am not sure is it the best way..but it seems to work.
{code}
Imports Autodesk.AutoCAD.Runtime
Public Class AutoLoad
Implements Autodesk.AutoCAD.Runtime.IExtensionApplication
Public Sub Initialize() Implements IExtensionApplication.Initialize
AddHandler Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.DocumentActivated, AddressOf ActivatedMessage
End Sub
Public Sub Terminate() Implements IExtensionApplication.Terminate
End Sub
Protected Overrides Sub Finalize()
MyBase.Finalize()
End Sub
Public Sub ActivatedMessage()
MsgBox("Hello!", MsgBoxStyle.Information, "Info")
End Sub
{code}