Ms word 2000 hangs up when Addin created vb6 contains Documents ev

R

ravi kumar

I have created a addin vb6. i declared application variable
Dim with events ohostApp as word.application

and added an event

Private Sub ohostApp_NewDocument(ByVal doc As Document)
'Your code here
MsgBox "New Document"
End Sub

it is working in word 2003 version, but not in word 2000
 
R

ravi kumar

Dennis,

Thanks for your reply.

i am able to run addin on word 2000 without Documents Events ( refrence to
the version 11), but the problem occurs when the code contains Documents
Events then the application hangs up. the addin has to be run on word 2000
and 2003. so i gave 11 version refrence. If i use version 9 it would not
work on 2003.

Regards

Ravi kumar
 
X

XL-Dennis

Hi Ravi,

It would be good if some of the other frequent posters could help you out
with the setup. Meanwhile you can take part of the following sources that may
help you:

Startpage of Word MVP site:
http://www.word.mvps.org/index.html

Pages that explicit target events.
http://www.word.mvps.org/FAQs/MacrosVBA/AppClassEvents.htm
http://www.word.mvps.org/FAQs/MacrosVBA/DocumentEvents.htm

---------------
With kind regards,
Dennis
Weekly Blog .NET & Excel: http://xldennis.wordpress.com/
My English site: http://www.excelkb.com/default.aspx
My Swedish site: http://www.xldennis.com/
 
C

Cindy M.

Hi =?Utf-8?B?cmF2aSBrdW1hcg==?=,
i am able to run addin on word 2000 without Documents Events ( refrence to
the version 11), but the problem occurs when the code contains Documents
Events then the application hangs up. the addin has to be run on word 2000
and 2003. so i gave 11 version refrence. If i use version 9 it would not
work on 2003.
Try doing as Dennis suggests, for testing purposes. As a general rule, you
should always program and compile against the *older* version, then test in
all the versions you plan to target.

The Word 2000 object model was "off" in a number of ways that got fixed in the
following versions. Things can work quite differently, even if the code looks
the same. Also, Word 2000 is very stubborn about not wanting to recognize or
work with references to newer versions.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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