Extra winword process using global add-in

M

MShaz

Howdy,

I have a global add-in template with the following code in a module:

Dim oAppClass As New EventClassModule

Public Sub AutoExec()
Set oAppClass.oApp = GetObject(, "Word.Application")
End Sub

And a class called EventClassModule that has the following,

Public WithEvents oApp As Word.Application

Private Sub oApp_DocumentOpen(ByVal Doc As Document)
If InStr(1, oApp.Dialogs(wdDialogToolsTemplates).Template, "foo") <> 0
Then
MsgBox "Got foo?", vbYesNo, "Foo?"
End If
End Sub

The code works, i.e. the dialog appears when expected, however, if I open
more than one document by selecting them as a group on the Desktop and
hitting the enter key an extra WINWORD.exe process is started and an extra
(blank) word application window is opened. This only happens when I open
multiple files in this way from the Desktop. Using windows explorer or the
start menu run command works fine (i.e. one window for each document, no
extras).

Has anyone else experienced this behaviour - presumably it is not normal?

I’m running MS Word 2003 SP2 and Windows XP Professional SP2.

Thanks,
M.
 

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