Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting non-shareable instance of Word (Office 2000)

    Does anyone know a way to open an instance of Word (via VB) which other applications cannot use? My problem is the following. My application opens an instance of Word. Then, if someone opens Outlook after my application starts and that person has Word as their default editor, Outlook grabs my instance of Word. This causes problems for me on shutdown. Is there a way to either (a) prevent Outlook from using my instance of Word ([img]/forums/images/smilies/cool.gif[/img] set an option in Outlook which forces it to open a new instance of Word?

    Thanks...

    Dan

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting non-shareable instance of Word (Office

    Hi Dan:
    I haven't had much network experience, so perhaps someone else who has will jump in. However, I would expect that another user should have their own version of Word on their local hard drive. And their Outlook should affect only that instance of Word. Doesn't the other user have his/her own profile?

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Getting non-shareable instance of Word (Office

    Is it an option to prevent them from using Word as their e-mail editor? In Office 2000, the marriage was not always a happy one...

    There are three ways to start Word: one is automation, one is running the application from the command line, and the third is launching Word according to the instructions in Windows Explorer's file types dialog. I don't know what Outlook does.

    In the case of automation, you undoubtedly are familiar with the GetObject(, "Word.Application") syntax that will attempt to create an object reference to any running instance of Word. I don't know if there is a way to defeat this by changing the identity of the application after your application launches it. This could violate some kind of fundamental OS security. Perhaps, though, there is a way to launch Word "as" a different application, call it, MyWordApp, so that GetObject comes up empty when trying to find your open instance of Word. This is way beyond my knowledge.

    In the second case, Word itself may have coded into its executable the behavior of re-using open instances of Word. If so, you can't defeat it. Or, Outlook may be using a startup switch that instructs Word to re-use an open instance of Word. Either way, you're out of luck. On the other hand, maybe there is an application option within Word somewhere to force a new instance to open every time? I don't remember ever seeing one, and in most cases this would create serious delays and memory usage issues that might be unacceptable to users, so it would be best to avoid creating this as a global default.

    In the third case, for example, under the DOC file type, the instructions are to use DDE if Word is running, and open the document in that instance of Word. You could disable this functionality, so that a new instance of Word always launched; same problem as above.

    So that's not an answer, but perhaps it gives you some ideas to explore?

  4. #4
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting non-shareable instance of Word (Office 2000)

    I'd think Jefferson's summary is fairly comprehensive.

    On the other hand, you can probably work around the problem a different way <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Rather than open an instance of Word - open two instances! In that way, dear old Outlook will be happy when it grabs the 'other' version.

    Jefferson - Outlook and Word are married - it is getting to be extremely difficult to fight Microsoft designs long term.

  5. #5
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting non-shareable instance of Word (Office 2000)

    Thanks all. In the amount of time I had to get this feature working, I couldn't come up with a foolproof solution, but have come up with something. The problem is that my app, among other things, loads a Word addin which, in turn (and against my will), gets loaded into Outlook email messages when they've got Word set as their email editor; I wanted to make sure the addin got unloaded when I exited. My first pass was to simply unload the addin on exiting my app. That sort of worked, except that, if somebody had an email message open when I unloaded the addin, it rendered the email editor completely unusable (at least in Office2K, which I must support). So then I decided on option B: use GetObject(,"Outlook.Application") to see if (a) somebody has Outlook open, ([img]/forums/images/smilies/cool.gif[/img] they have Word as their Editor, have email messages open (I found you could do this by using Outlook's Inspector collection and checking the Inspector.IsWordMail property), and (d) have my addin loaded in those email messages (you can use the Inspector.WordEditor property to get the email's Word document object). If all the above conditions are true, I issue a warning that they've got to close or send their open emails before my app can shut down.

    One thing which I've been wondering since implementing this hack is: can you remove a particular Word object from the Running Object Table (ROT)? I believe that, if the object isn't there, an app (such as Outlook) can't get at it via GetObject. I'm relatively satisfied with my current workaround, but would love to figure out something a tad more elegant.

    Dan

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting non-shareable instance of Word (Office 2000)

    Have you tried changing the default email editor before your code runs?
    And then restore the setting after your code runs.

  7. #7
    2 Star Lounger
    Join Date
    Sep 2002
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting non-shareable instance of Word (Office 2000)

    Howard--that's a tempting alternative, but I think people might get annoyed if I just change their email editor from underneath them. Also, there's no good way--that I'm aware of--for me to detect when they've started Outlook....Dan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •