title: How to save the active "Word" document in VBScript?
body: <p>Here I have a small VBS script that helps me append a new line to a table in MS "Word" 2003:</p>
  
  <pre><code>Set wd = CreateObject("Word.Application")
  
  wd.Visible = True
  
  Set doc = wd.Documents.Open ("c:\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
  </code></pre>
  
  <p>It works fine, but it doesn't save anything. I want it to save the performed changes. </p>
  
  <p>By the method of macro-recording in the "Word" I got this macro command that saves active "Word" document: </p>
  
  <pre><code>ActiveDocument.Save
  </code></pre>
  
  <p>So, I decided to append this macro to the VBS script above:</p>
  
  <pre><code> Set wd = CreateObject("Word.Application")
  
      wd.Visible = True
  
      Set doc = wd.Documents.Open ("c:\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
  
       ActiveDocument.Save
  </code></pre>
  
  <p>But it doesn't save anything. What am I doing wrong here?</p>