title: Delete .doc duplication during PDF conversion c#
body: <p>I currently have a program that merges a folder consisting of word docs into one combined file via user input with a FileBrowserDialog. Once files are selected, a 'combine' button applies the code shown below which sources the folder containing the documents, output location and name of the file created. </p>
  
  <pre><code>string fileDate = DateTime.Now.ToString("dd-MM-yy");
  string fileTime = DateTime.Now.ToString("HH.mm.ss");
  string outcomeFolder = outputFolder;
  string outputFileType = ".docx";
  string outputFile = "Combined Folder " + fileDate + " @ " + fileTime + outputFileType;
  string outputFileName = Path.Combine(outcomeFolder, outputFile);
  
  // Combines the file name, output path selected and the yes / no for pagebreaks. 
  MsWord.Merge(sourceFiles, outputFileName, pageBreaker);
  
  // Message displaying how many files are combined. 
  MessageBox.Show("A total of " + sourceFiles.Length.ToString() + " documents have been merged", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);}
  </code></pre>
  
  <p>The MsWord referenced calls a separate .CS file which combines the folder components, output name and a boolean to enable page-breaks. The MsWord also automatically saves the word .doc to the user specified location once the contents of the folder are successfully combined. <code>MsWord.Merge(sourceFiles, outputFileName, pageBreaker);</code></p>
  
  <p>The issue i'm wanting to address is, when I enable this check box:</p>
  
  <pre><code>if (convert2PDFBox.Checked)
  Microsoft.Office.Interop.Word.Application officeApp = new Microsoft.Office.Interop.Word.Application();
  
  officeApp.Documents.Open(outputFileName);
  outputFileType = ".pdf";
  officeApp.ActiveDocument.SaveAs(outputFileName + outputFileType, WdSaveFormat.wdFormatPDF);
  officeApp.Quit();
  </code></pre>
  
  <p>I want the program to solely create a PDF of the combined folder and not 2 seperate .doc and .PDF files, which it currently does. Since the MsWord.save function is called separately and is essential to the overall function of my program, I was wondering is there a possibility of deleting the initially combined file once conversion of the PDF takes place? <strong><em>e.g. "combinedDocument".Delete</em></strong> - Essentially allowing the copy to take place however not presenting the user with the initial .doc - only the .PDF</p>
  
  <p>Though the issue is small, I would love to get it addressed and welcome any suggestions or advice with this manner. I can also provide any additional information if needed, thank you.</p>
  
  <p><em>tl;dr -</em> merging program creates an amalgamated Word .doc, which i want to change solely to a PDF when a checkbox is enabled instead of creating a .doc and PDF.</p>