title: Reading a data source for bulk letters
body: <p>I have written a macro in VBA to seperate bulk letters and to save them as pdf documents.
  Using a built-in datasource in Word ( Access database i think ) for testing purposes works fine here. But as I try to use other datasources like .txt or .csv, the macro only saves the first entry of the bulk letter. I already figured out that the problem is the Datasource RecordCount. I displayed </p>
  
  <pre><code>ActiveDocument.MailMerge.DataSource.RecordCount
  </code></pre>
  
  <p>and the result was <code>-1</code> although there are about 30 entries. </p>
  
  <p>The bulk letters in Word itself are displayed as they should; all entries are there. The format of the datasource is simple csv like this:</p>
  
  <pre><code>employeenr; title; firstname; name;
  5000001   ; Dr.  ; Max      ; Must;
  5000002   ;      ; Rita     ; Rat ;
  </code></pre>
  
  <p>So what could be the problem of VBA not reading the datasource correctly if it's already done by word? Are there some special restrictions for data sources and there formats?</p>
  
  <p>In case it's needed, here the part of the code where it iterates through the datasource:</p>
  
  <pre><code>With ActiveDocument.MailMerge
      .DataSource.ActiveRecord = 1
      Do
          .Destination = wdSendToNewDocument
          .SuppressBlankLines = True
          With .DataSource
              .FirstRecord = .ActiveRecord
              .LastRecord = .ActiveRecord
              sBrief = Path &amp; .DataFields("employeenr").Value &amp; "_" &amp; Data &amp; ".pdf"
          End With
          .Execute Pause:=False
  
          If .DataSource.DataFields("employeenr").Value &gt; "" Then
              ActiveDocument.SaveAs FileName:=sBrief, FileFormat:=wdFormatPDF
          End If
          ActiveDocument.Close False
  
          If .DataSource.ActiveRecord &lt; .DataSource.RecordCount Then
              .DataSource.ActiveRecord = wdNextRecord
          Else
              Exit Do
          End If
      Loop
  End With
  </code></pre>