Results 1 to 5 of 5

Thread: get rid of process?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    BC, Canada
    Posts
    142

    Post

    I got somehow similar problem with word doc. printing. A msg. shows up asking if you want to quit the word without printing. So I put a couple of seconds time delay before the word quits and it worked fine. The problem is that printing a doc. or saving a file takes time and the processing doesn't wait.
    There might be a better way to avoid this.

  2. #2
    Hyperactive Member badgers's Avatar
    Join Date
    Sep 1999
    Location
    Madison, WI USA
    Posts
    444

    Post

    Dim Hard As Word.Application
    Set Hard = New Word.Application
    Hard.Documents.Open "c:\ed_cs.rtf"
    Hard.ActiveDocument.SaveAs "c:\ed_cs.txt", wdFormatDOSTextLineBreaks
    Hard.Quit
    Set Hard = Nothing
    this code opens word and then gets word to save the file with linebreaks. This code is in a command button's click event.
    If I check the task manager their is still a process called winword.exe running.
    how do I get this code to remove itself from memory and get rid of the process.
    It is a problem because I get an error the next time the button is clicked.


    ------------------
    I am so skeptacle, I can hardly believe it!

  3. #3
    Guest

    Post

    This example shows you how to open word and load a word document. and how you close your document and close word application.

    Dim objWordApp As Object

    Set objWordApp = GetObject("", "Word.Application.8")
    If objWordApp Is Nothing Then
    Set objWordApp = CreateObject("Word.Application.8")
    End If

    objWordApp.Documents.Open FileName:="C:\MyWord.Doc"

    objWordApp.Documents(1).SaveAs "c:\finish.Doc"
    objWordApp.Documents(1).Close
    objWordApp.Quit

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Examples of early binding w/ MS Word:

    http://www.vb-world.net/ubb/Forum1/HTML/012330.html

    http://www.vb-world.net/ubb/Forum1/HTML/012578.html

    print message box problem apparently resolved in link #2


    [This message has been edited by Clunietp (edited 01-13-2000).]

  5. #5
    Hyperactive Member badgers's Avatar
    Join Date
    Sep 1999
    Location
    Madison, WI USA
    Posts
    444

    Post

    it is my understanding that your example uses late binding.
    I am trying to use early binding for this project. I understand and have used your method before. I would like to thank you for your time and help. Do you have an example using early binding?
    thank you for your time and have a good day

    ------------------
    I am so skeptacle, I can hardly believe it!

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