word object for events

S

Shinya

Dear all,

In my word addin I have set up word.application variable like this.
I declared one in global so that all function get access to worddoc
and the other one in connect class module to impliment event handler.

'Global variable in Module(wordGlobal.bas)

Public wordDoc As New Word.Application

'Class Module(Connect.cls)

Dim withEvents wordDocEvent as Word.application


inside of "IDTExtensibility2_OnConnection" function
I set Application object to both of them

If Application = "Microsoft Word" Then
Set wordDoc = Application
Set wordDocEvent = Application
End If

Is there any way to put this two object(Word.Application) in one to make it
simple.
or I am doing something weired?

Shinya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top