Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 03-13-2017, 11:35 AM
Charles Kenyon Charles Kenyon is offline Save document multiple times with date as filename Windows 10 Save document multiple times with date as filename Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,582
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

That macro was designed to be called from another macro that would supply a name. You could simplify the process:

Code:
Public Sub FileSave()
    ' Run as substitute for FileSave to add date to default document names
    ' Put in a document or global template as public macro
    ' Base name comes from the Title Property in the template

    Dim dlgSave As Dialog
        On Error Resume Next
   
    If Len(ActiveDocument.Path) > 0 Then
      ' The document has already been saved at least once.
      ' Just save and exit the macro.
      ActiveDocument.Save
      Exit Sub
    End If
    '
     'get name from title property
    strName = ActiveDocument.BuiltInDocumentProperties("Title").Value
    '   
    strName = strName & " " & Format((Year(Now() + 1) Mod 100), "20##") & "-" & _
        Format((Month(Now() + 1) Mod 100), "0#") & "-" & _
        Format((Day(Now()) Mod 100), "0#")
'
    Set dlgSave = Dialogs(wdDialogFileSaveAs)
    With dlgSave
        .Name = strName
        .Show
    End With
End Sub
Remember, if you want any base name rather than just the date, put that name in the Title property of your template.
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save document multiple times with date as filename How can I save a Word Document as a PDF file with a merged field filename? kp2009 Word VBA 5 08-27-2015 11:45 PM
Using DocProperty Field Codes multiple times in the same document trueimage Word 2 09-18-2013 04:44 PM
Save document multiple times with date as filename Appending the filename with the current date sheeand Word VBA 2 05-14-2012 05:18 AM
Save document multiple times with date as filename How to insert current date into default filename ? czomberzdaniela Word 1 12-27-2011 07:18 PM
Save document multiple times with date as filename Save Filename using Document Text Knawl Word 11 10-10-2011 03:00 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft