title: vb script single line mail merge
body: <p>I have a peculiar need. I need to be able to read a single line from a csv file, merge the data into a mailmerge document, save the document with a unique name, proceed to the next line, rinse and repeat.</p>
  
  <p>I am complete unaware of how to use/merge a single line of data extracted from a file as a data source for a mail merge.  Can someone give me some insight into what the oDoc.mailmerge... line below should look like?</p>
  
  <p>I know the open and closes in the code below isn't efficient, this is something I through together quickly to get my point across.  I can work the rest out. I just need help with the merge line.</p>
  
  <pre><code>DATAFILE = "test.txt"
  DOCFILE  = "myDoc.doc"
  listFile  = fso.OpenTextFile(DATAFILE).ReadAll
  listLines = Split(listFile, vbCrLf)
  For Each line In listLines
     WScript.Echo line 
     'My Stuff
     dim objWord, oDoc, wdName
     Set objword = CreateObject("Word.Application")
  
     wdName = "D:\My Documents\DOCFILE"
  
     set oDoc = objword.Documents.Open (wdName)
     objword.Visible = True
  
     oDoc.MailMerge.OpenDataSource ?line?, , ,True, , , , , , , , , "IDONTKNOWWHATGOESHERE"
     oDoc.MailMerge.Execute
  
     oDoc.PrintOut
     'redefine savename and execute save here
     oDoc.Close()
     objword.Quit (0)
  Next
  </code></pre>