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

    Strange Word/Outlook Interaction (2000/XP)

    I tried posting this on the Word board, which was probably the wrong place since this is primarily an Outlook strangeness.

    I've got an application which opens Word and then loads an addin. I've just noticed that, if you start Outlook after my application has started, and if you've set Word as your email editor in Outlook, then Outlook seems to inherit the addin. (I can tell this because of the toolbar buttons which appear in new email messages). Then, when I shut down my app, the addin stays loaded in Outlook--which I don't want. So I tried unloading the addin before exiting my app, which gets rid of the addin but leads to other strangeness: despite the fact that I've called application.quit from my code, an empty Word window appears. If I hit Alt-F11, I find that this window has an "email" template project loaded. Then, when I close the empty Word window, and close Outlook, I still see Winword running in the task manager.

    So I have several questions:

    1. Is there anyway to prevent Outlook from attaching to already running version of Word?
    2. Where is this empty Word window coming from after I exit from my app, and how can I get rid of it?
    3. When I close the empty Word window and close Outlook, why is there still a Winword running?

    Thanks...

    Dan

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Strange Word/Outlook Interaction (2000/XP)

    It is "normal" when you are using Word as your Outlook email editor to have Winword continue running in the background (viz. Task Manager visible) long after Outlook has disappeared. This seems to be the likely cause also of your question 2 - interacting with your AddIn.

    The interaction of Outlook and Word (as email editor) is not AFAIK something that Microsoft have "exposed" to the "outside" world. Thus I suspect the writer of your Add-In would have trouble eliminating the side effects in both your question 1 and (apparently) question 2 - if he/she wished to do so. If you had some pretty heavy duty coding skills on tap, you might be able to fix it yourself, but I suspect you would not be asking us the question in those circumstances.

    I wish I could say something more helpful.
    Gre

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

    Re: Strange Word/Outlook Interaction (2000/XP)

    Thanks. Actually, I am the writer of the addin. If I were to apply some "heavy-duty" coding to solve this problem, do you know (in broad terms, at least) what I'd need to do?

    Dan

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Strange Word/Outlook Interaction (2000/XP)

    The fundamental issue is that, if you select Word to edit your email messages, that's what you get.

    Thus, in order to get your AddIn to hide, you might trying seeing whether you can find out anything from the Toolbars which do NOT show up in Outlook despite their being partt of your default set-up in Word: the Reviewing Toolbar is an example. You will probably have to experiment to see whether you can uncover anything.

    In addition to (or instead of) calling Application.Quit, you will need to set Application.Visible to False in order to hide the "lurking" Word window.

    HTH
    Gre

  5. #5
    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: Strange Word/Outlook Interaction (2000/XP)

    Somewhere in the Word object model is the boolean property IsWordMail or something similar thereto. Not sure if this really helps, other than to allow you to enable or disable your own add-in. If Word is the mail editor for Outlook, Outlook will want to be in the driver's seat for that relationship.

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

    Re: Strange Word/Outlook Interaction (2000/XP)

    Hi. Sorry for the delay. I had tried turning the app invisible before exiting from the addin code, but it didn't seem to do anything. Then I realized that I was uninstalling the addin before calling application.visible=FALSE. It appears that when you uninstall the addin, the code stops executing--which I guess makes sense. When I set the application invisible BEFORE uninstalling the addin, that seemed to work. I'm detecting that Outlook has hold of my instance of word by looking for the email.dot addin; if it's there then I set the app invisible and uninstall, otherwise I just call application.quit.

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

    Re: Strange Word/Outlook Interaction (2000/XP)

    Hi. Couldn't find the option. Do you have any more details?

    Thanks...

    Dan

  8. #8
    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: Strange Word/Outlook Interaction (2000/XP)

    Actually, I think that's in the Outlook object model. Here's something you could try in Word, just hastily thrown together right now:
    <pre>Function IsComposingMail() As Boolean
    'Use error code returned by accessing a property to test status
    Dim strAuth As String
    On Error Resume Next
    strAuth = ActiveDocument.Email.CurrentEmailAuthor
    If Err.Number = 0 Then
    IsComposingMail = True
    Else
    If Err.Number = 6022 Then 'not composing
    IsComposingMail = False
    Else
    MsgBox Err.Number & vbCrLf & Err.Description, vbCritical
    End If
    Err.Clear
    End If
    On Error GoTo 0
    End Function

    Sub TestFunc()
    MsgBox IsComposingMail
    End Sub</pre>

    Hope this helps.

Posting Permissions

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