Getting access to Word Object Model in the shim

P

pavvu_kk

Hello Everyone,
Issue 1:
We need help in getting access to Word Object model in the shim. Is it
possible?

Details:
We have developed a COM addin for Word using IDTExtensibility2
interface in managed C# (not through VSTO). We've also developed a shim
(unmanaged C++ code) and are loading the COM add-in from the shim. The
functionality of the word add-in is not applicable to all word
documents. Hence, we identify the documents, based on XML tags for Word
2003 documents and fields for Word XP documents, in our DocumentOpen
and NewDocument event handlers. If we find that the document is valid,
we run furthur code.

Now, we need to do this same check in our shim code and upon finding
that it is not a valid document we dont want to load the COM word
add-in. While doing the check in COM Word add-in we have access to the
word object model from OnConnection event handler and access to the
active document from the DocumentOpen/NewDocument event handler. How do
we get access to these objects in our shim?


Issue 2:
We also want to try and not the CLR itself IF we can identify that the
user is opening an invalid document i.e. a document on which we do not
run any code. Is there any way to do this?

We trying all these options to make sure that word load time is
reduced, at least, for those documents which we do not make any changes
to.

Any pointers in this regard will be of great help

TIA
Regards,
Pavan
 

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