Still getting nowhere!! I will try and describe what I am trying to do.
VB application is a database
A user selects a list of names to go in a listbox.
He presses a button, word opens, and the names put into wordtable.
Word when opened is maximized. The user closes it, getting a prompt to save the document. At this stage he answers no.
Word then appears to go away/closed. However the next time he hits the button, Word had not closed, because a message comes up a table is already in the destination document. Or a runtime error 462 appears.
If I do the same operation without making any changes (ie not putting in a word table), the same document Document1 appears each time without any problems.
Somebody must know how to terminate a dirty document/application so it can be called again? New code below avoids the .add statement.
Private Sub Command1_Click()
Dim ObjWord As Word.Application
Dim objWordDoc As Word.Document
Set ObjWord = CreateObject("Word.Application"
Set objWordDoc = ObjWord.Documents.Open("G:\NEWEASTENDERS\EASTEND2.DOT"
ObjWord.Visible = True
ObjWord.WindowState = wdWindowStateNormal
' Start by putting in a table
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=6, NumColumns:=1
Selection.Tables(1).Columns.Width = InchesToPoints(4.5)
How do I KILL THE DOCUMENT AFTERWARDS AND QUIT WORD READY FOR NEXT TIME - Simple to someone