Results 1 to 2 of 2

Thread: Ending a process in NT

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    1

    Ending a process in NT

    Help! I want to convert a Word.doc to a Word.rtf for use in the MS richtextbox control.

    I'm doing: -

    Dim wdDoc As Word.Document
    Set wdDoc = GetObject("c:\cvs\CV.doc")
    wdDoc .SaveAs "C:\cvs\temp\CV.rtf", wdFormatRTF
    Set wdDoc = Nothing

    Which works fine, except it leaves an orphan instance of WINWORD.EXE running in the processes window of task manager (NT 4). Also, this leaves an orphan ~$CV.doc and ~$CV.rtf file on the drive, and I can't open the RTF file straight away, as it's locked by WINWORD.EXE. GetObject(,"word.application"0 returns an error, so I can't use thsi to close it, and there's no Word instance window, so I can't use that method to close it either.

    I've then used an API call to the kernel32 library to copy the file somewhere else, so I can open it and, on exiting the application, I fugure I'll delete the temp folder. However, the WINWORD.EXE instance, which hangas about indefinitely, prevents deletion, 'cos it's still got lock on the original CV.rtf file.

    So - my questions are: -

    - is there a better way to convert .doc to .rtf? My users won't have Word on their PCs, but I am hoping that distribution of the word9 object library will do the job (large though it is).

    - how can I close the WINWORD.EXE process assuming GetObject(,"word.application") returns nothing, 'cos the users isn't using Word for something else?

    Please - any ideas appeciated!

  2. #2
    Frenzied Member numtel's Avatar
    Join Date
    Apr 2000
    Location
    CA
    Posts
    1,163
    The security in NT is too much, u cant close a process with the api.

Posting Permissions

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



Click Here to Expand Forum to Full Width