Is this the correct way to dump all the files in Trim?

Could someone just review the code below to see if this is the correct way to dump to disk all the files in Trim?

 

 

using (Database db = new Database())
{
   db.WorkgroupServerName = "trimsrv";
   db.Connect();

   Directory.CreateDirectory(@"C:\temp\trimdump");

   TrimMainObjectSearch records = new TrimMainObjectSearch(db, BaseObjectTypes.Record);
   records.SelectAll();
   records.SetFilterString("type:document");
   foreach (Record resultRecord in records)
   {
      using (var d = resultRecord.GetExtractDocument())
       {
           if (d != null)
           {
               d.DoExtract(@"C:\temp\trimdump", true, false, "");
           }
       }
   }
}

 

 

Cheers

John