title: VBA to generate a default file name when Save As is selected in Word 2016
body: <p>I have VBA that, in Word 2010, will default a file name into the Save As screen when the user selects the Save As file option.  Word 2016 (Office 365) has a different interface with a screen to select a save location (OneDrive, This PC,etc) prior to the "standard" Save As dialog box appearing which seems to have broken the code to generate a specified default file name.</p>
  
  <p>The code (with title simplified) is</p>
  
  <pre><code>  Sub FileSaveAs()
  
    With Dialogs(wdDialogFileSaveAs)
      .Name = "MyTitle"
      .Show
    End With
  
    End Sub
  </code></pre>
  
  <p>If I run the code in Developer to Debug, it works fine, with the Save As screen appearing and the file name defaulting but it does not work in the live environment where the file name defaults to the previous document name.</p>
  
  <p>Based on web research, I have tried additional code to change the properties of the document place the name in the title as this is supposed to then default when Save As is selected but that also doesn't work.</p>
  
  <p>Any suggestions or recommendations on how to resolve this would be appreciated. </p>
  
  <p>Thanks!</p>
  
  <p>Update 1/11/16: 
    Have been able to get a little closer by using the following:
    Application.DocumentBeforeSave Event
    example here <a href="https://msdn.microsoft.com/en-us/library/office/ff838299.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/office/ff838299.aspx</a>
    tied to Using Events with Application Object 
    example here <a href="https://msdn.microsoft.com/en-us/library/office/ff821218.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/office/ff821218.aspx</a></p>
  
  <p>Had to add</p>
  
  <pre><code>Cancel=True
  </code></pre>
  
  <p>to the end of the event procedure code or the Save as Dialog box will open twice.
  Still a bit clunky and seems to be limited to run only before the first user generated save event but almost workable.</p>
  
  <p>Wanted to share what I found in case it helps others but any other suggestions for improvement would be appreciated as it still doesn't seem like the best solution.
  Thanks again!</p>