My example is given at the bottom. I need to call it from Word VBA. When I
build it I get two files one dll and other tlb. Can I just add these to
references in Word and start using or do I need to do something else before
that?
Thanks
Regards
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
<Assembly: AssemblyKeyFile("C:\Events
Manager\Contacts\EventHelper\EventHelper\EventHelp er.snk")>
Namespace MyCompany.EventHelper
Public Interface IEventHelper
Event WordDocSaved(ByRef Doc As Object)
Event WordDocPrinted(ByRef Doc As Object)
Function Instance() As IEventHelper
Sub RaiseWordDocSaved(ByRef Doc As Object)
Sub RaiseWordDocPrinted(ByRef Doc As Object)
End Interface
<ClassInterface(ClassInterfaceType.None)> _
Public Class EventHelper
Implements IEventHelper
Public Event WordDocSaved(ByRef Doc As Object) Implements
IEventHelper.WordDocSaved
Public Event WordDocPrinted(ByRef Doc As Object) Implements
IEventHelper.WordDocPrinted
Private Shared _Instance As EventHelper
Public Function Instance() As IEventHelper Implements IEventHelper.Instance
If (_Instance Is Nothing) Then
SyncLock GetType(EventHelper)
If (_Instance Is Nothing) Then
_Instance = New EventHelper
End If
End SyncLock
End If
Return _Instance
End Function
Public Sub RaiseWordDocSaved(ByRef Doc As Object) Implements
IEventHelper.RaiseWordDocSaved
RaiseEvent WordDocSaved(Doc)
End Sub
Public Sub RaiseWordDocPrinted(ByRef Doc As Object) Implements
IEventHelper.RaiseWordDocPrinted
RaiseEvent WordDocPrinted(Doc)
End Sub
End Class
End Namespace
"Jonathan West" <jw***@mvps.org> wrote in message
news:O0****************@TK2MSFTNGP12.phx.gbl...
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Ob**************@TK2MSFTNGP10.phx.gbl... What I need is that when word does something, it informs the calling vb.net app. Therefore I need word to be able to communicate with the vb.net
app.
It depends rather on what that something is and the circumstances in which
the VB.NET app is listening.
--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup