title: Way to default the name of the generated XPS file?
body: <p>If a user prints a report, and they happen to be using the <strong>Microsoft XPS printer</strong>, i would like the default the filename to something meaningful.</p>
  
  <p>i would have thought that the XPS printer would take the name of the print job, and use that as the default filename - but it doesn't.</p>
  
  <p>Is there some other, programatic, way to default the name of the generated XPS file when i print to that printer? i was thinking there might be something like:</p>
  
  <ul>
  <li>a registry key</li>
  <li>global shared memory</li>
  <li>API call like SetDefaultXPSFilename()</li>
  <li>extended attributes about a print job</li>
  </ul>
  
  <h2>Example</h2>
  
  <p>Automate Excel to create a spreadsheet:</p>
  
  <pre><code>Excel xl = new ExcelApplication();
  Workbook wb = xl.Workbooks.Add();
  GenerateReport(wb);
  wb.PrintOut();
  </code></pre>
  
  <p>Now if the user's default printer is the <code>Microsoft XPS Document Writer</code>, then the user will get:</p>
  
  <p><a href="https://i.stack.imgur.com/H7ArM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H7ArM.png" alt="enter image description here"></a></p>
  
  <p>i would like a way for that <code>File name</code> to be defaulted to something useful, such as:</p>
  
  <pre><code>20110729 - Chip Bank Settlement Sheet.xps
  </code></pre>
  
  <p>The user will accept the default filename, and files will organized automatically, rather than the user typing:</p>
  
  <pre><code>asdfadf.xps
  </code></pre>
  
  <hr>
  
  <h2>References</h2>
  
  <ul>
  <li><a href="http://www.eggheadcafe.com/software/aspnet/30644727/xps-default-file-name.aspx" rel="nofollow noreferrer">eggheadcafe: XPS Default File Name </a></li>
  <li><a href="http://social.msdn.microsoft.com/Forums/en-US/windowsxps/thread/362da945-575f-41a6-8588-68d71929f146" rel="nofollow noreferrer">MSDN: XPS Name when Sent to Printer</a></li>
  </ul>
  
  <p><strong>Bump: 20110729 (12 months later)</strong></p>