Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Word Automation

Word Automation

Scheduled Pinned Locked Moved Visual Basic
questioncsharptestingtools
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Emile Jacobs
    wrote on last edited by
    #1

    I initiate an instance of Word with the following code, and send values from my form to the Word Template. After Word closes, an instance of WINWORD.EXE still runs in the Windows Tasklist -> Processes. How do I close ALL instances of WINWORD.EXE after closing my VB.NET project? Dim oWord As Word.Application Dim oDoc As Word.Document oWord = CreateObject("Word.Application") oWord.Visible = True oDoc = oWord.Documents.Add("AffiliationInvoice.dot") oDoc.Bookmarks.Item("AffiliationName").Range.Text = txtName.Text oDoc.Bookmarks.Item("AffiliationNumber").Range.Text = txtAffiliationLetter.Text & " " & txtAffiliationNumber.Text oDoc.Bookmarks.Item("ContactName").Range.Text = lblContactName2.Text oDoc.Bookmarks.Item("ContactTel").Range.Text = lblTelHome2.Text :confused:

    N 1 Reply Last reply
    0
    • E Emile Jacobs

      I initiate an instance of Word with the following code, and send values from my form to the Word Template. After Word closes, an instance of WINWORD.EXE still runs in the Windows Tasklist -> Processes. How do I close ALL instances of WINWORD.EXE after closing my VB.NET project? Dim oWord As Word.Application Dim oDoc As Word.Document oWord = CreateObject("Word.Application") oWord.Visible = True oDoc = oWord.Documents.Add("AffiliationInvoice.dot") oDoc.Bookmarks.Item("AffiliationName").Range.Text = txtName.Text oDoc.Bookmarks.Item("AffiliationNumber").Range.Text = txtAffiliationLetter.Text & " " & txtAffiliationNumber.Text oDoc.Bookmarks.Item("ContactName").Range.Text = lblContactName2.Text oDoc.Bookmarks.Item("ContactTel").Range.Text = lblTelHome2.Text :confused:

      N Offline
      N Offline
      Nick Seng
      wrote on last edited by
      #2

      Are you running a web app or a window app? Did you call oDoc.Close? How about oWord.Quit ?


      God, I pity me! - Phoncible P. Bone If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups