title: VBA Word - Save As dialog with initial filename
body: <p>I have a vba macro that makes some changes to the current document and determines a filename that should be used for it - if the document isn't saved as that filename yet the user should be prompted to do so (but should be able to alter the default setting).</p>
  
  <p>I found two possibilities that both are not perfect (I'd need a mix of those two).</p>
  
  <p>First approach:</p>
  
  <pre><code>Application.Dialogs(wdDialogFileSaveAs).Show
  </code></pre>
  
  <p>Opens the <code>Save As</code> dialog and lets you change the format and name of the file, but the default file name is the old filename or the title (up to the first special character like blank or <code>-</code>) of the document (in case it wasn't saved yet - changing the title of the document is of little help as the suggested filename will contain <code>-</code>). Is it possible to change the initial filename shown in the <code>Save As</code> dialog?</p>
  
  <p>Second approach:</p>
  
  <pre><code>Application.FileDialog(msoFileDialogSaveAs).InitialFileName = filename
  Dim choice As Integer
  choice = Application.FileDialog(msoFileDialogSaveAs).Show
  If choice &lt;&gt; 0 Then
      filename = Application.FileDialog(msoFileDialogSaveAs).SelectedItems(1)
      Call ActiveDocument.SaveAs(filename:=filename, FileFormat:=wdFormatDocumentDefault)
  End If
  </code></pre>
  
  <p>The <code>FileDialog</code> will choose a filename only, so we have to save it explicitely.
  This approach will show the <code>filename</code> I want, but if the user changes the suffix to e.g <code>.pdf</code> the file will still be saved in the <code>.docx</code> format (using the suffix <em>.pdf</em>). I didn't plan to have huge distinction of cases here for the rare case the user needs a different format than <code>.docx</code>. Is there an easy way to save the file in the correct format using this second approach?</p>