Outlook and Word as Email Editor oddness

D

Darin Higgins

Hi all,

I was wondering if anyone else has had any peculiar behavior when trying
to utilize Word as a component from within Outlook when the user has
turned on the Word As Email Editor option.

Here's the scenario

1. Office 2000 (haven't tried 2003 yet, but I've got to target all the
way back to 2000)
2. VB6 COM addin for Outlook
3. User has Word as Email editor turned on.
4. Start outlook.
5. Within about 10 seconds, outlook opens a hidden instance of Word.
6. User creates a new MEETING REQUEST.
7. Clicks Send
8. My Add in intercepts to ITEMSEND event to do some processing on the
message.
9. one of the things it does is extract all WORD doc attachments.
10. if there are any, I get access to an instance of Word (via the
standard technique posted here and elsewhere, Ie Attempt to GETOBJECT,
to retrieve the running instance, and if that fails, use CREATEOBJECT)
11. For each word attachment
12. Load it up in to the Word instance I just obtained, do some
processing, Save and close.
13. When I'm all done, if I had to CREATEOBJECT the word object, I QUIT
it and release it.

Here's the weirdness.

If I ONLY use CREATEOBJECT to always create a new background instance of
Word.APPLICATION, then everything works like it should (except in some
installations, I get errors from word about how NORMAL.DOT has changed
when it hasn't, which I know is caused by improperly written macro code
out of my control)

However, if I use GETOBJECT and the instance of Word that I get is the
same one that Outlook created behind the scenes, I end up with all sorts
of peculiar behavior.

For example:
1. If I open a document with the VISIBLE argument FALSE, the open fails,
if I use true it works.
2. Accessing anything having to do with VERSIONS or the
BUILTINPROPERTIES (and possibly other properties) in the word document
causes the background instance to not unload. My add in doesn't
explicitly QUIT the background instance because I didn't create it, but
I definitely release all my references to it. I know that's happening
because all my objects are being terminated properly when OUTLOOK
terminates, and OUTLOOK does terminate properly (no left over instances
in taskman), but WINWORD is still loaded.


It may be that I just should always Create the word object before I use
it and NOT attempt to use an already existing one.

I was just wondering if anyone else has had similiar experiences

Thanks
Darin
 

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