Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Clearing Unwanted instances of Word from memory (Office 2000 SP 1A)

    Sometimes (often, it seems) you know you have an instance of Word that is not entirely closed and removed from memory even though it does not appear in the Windows 2000 task manager. This can create conflict problems. Is there any code to remove such instances or is it impossible by definition if the instance is in any degree a renegade one?

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Clearing Unwanted instances of Word from memory (Office 2000 SP 1A)

    David,

    There may be an API-based way to get at the specific Word tasks - but I can't help you with that.

    You could use the Tasks method in Word; the only drawback being it will end all current Word tasks including the one the code is running from! Anyway fwiw:

    <pre>Public Sub EndAllWordTasks()
    'Word 2000/Windows 2000
    Dim aTask As Task
    For Each aTask In Tasks
    'Debug.Print aTask.Name
    If Right$(aTask.Name, 14) = ("Microsoft Word") Then
    aTask.Close
    End If
    Next 'aTask
    End Sub</pre>

    Gary

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Clearing Unwanted instances of Word from memory (Office 2000 SP 1A)

    Thanks, Gary.
    Normally I get this situation when something goes wrong whilst automating Word from Access. So if I used the code from within Access then it doesn't matter about what other word tasks are occurring so I will try this.

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Clearing Unwanted instances of Word from memory (Office 2000 SP 1A)

    As long as a user didn't have a new and unsaved Word document already open in another Word session! <img src=/S/yikes.gif border=0 alt=yikes width=15 height=15>

Posting Permissions

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