I just received this VBS code that appends a line to my table in MS "Word" 2003. It works fine, but I want it to add a line to the table without opening the file. Is it possible ? Or, perhaps, I need to use some command that would close the document as soon as it is opened.
Set wd = CreateObject("Word.Application")
wd.Visible = True
Set doc = wd.Documents.Open ("c:\docs\addtotable.doc")
Set r = doc.Tables(1).Rows.Add
aa = Split("turtle,dog,rooster,maple", ",")
For i = 0 To r.Cells.Count - 1
r.Cells(i + 1).Range.Text = aa(i)
Next