KutoolsforOffice β€” One Suite. Five Tools. Get More Done.February Sale: 20% Off

How to save Word document with current date in filename?

AuthorXiaoyangLast modified

If you need to add the current date in filename automatically when saving a Word document, how could you deal with this task in Word file?

Save a Word document with current date in filename with VBA code


Save a Word document with current date in filename with VBA code

To automatically add the current date into the filename when saving the Word document, please do with the following steps:

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. And then, click Insert > Module, copy and paste below code into the opened blank module:

VBA code: Save a Word document with current date in filename

Public Sub FileSave1()
    Dim xDlg As Dialog
    Dim xTitle As String
    On Error Resume Next
    xTitle = ActiveDocument.BuiltInDocumentProperties("Title").Value
    xTitle = xTitle & " " & Format((Year(Now() + 1) Mod 100), "20##") & "-" & _
        Format((Month(Now() + 1) Mod 100), "0#") & "-" & _
        Format((Day(Now()) Mod 100), "0#")
    Set xDlg = Dialogs(wdDialogFileSaveAs)
    xDlg.Name = xTitle
    xDlg.Show
End Sub

3. After pasting the code into the module, press F5 key to run this code, and a Save As window is displayed with the current date automatically into the File name text box, see screenshot:

Save As window with the current date in the File name text box

4. And then, you just need to type your own file name as you need, see screenshot:

Edit the file name as needed

Do More in Less Time with AI-Enhanced Kutools for Word

Kutools for Word isn't just a set of tools - it's a smart solution designed to boost your productivity. With AI-driven capabilities and the most essential features, Kutools helps you accomplish more in less time:

  • Summarize, rewrite, compose, and translate content instantly.
  • Proofread text in real-time with grammar, punctuation, and style suggestions as you write.
  • Rephrase and translate content while keeping layout, style, and structure untouched.
  • Translate your content into over 40 languages with ease, expanding your reach globally.
  • Receive instant help and intelligent insights based on your current document content.
  • Ask how to complete a task - like removing section breaks - and the AI will guide you or do it for you.
  • Redact sensitive or confidential information in seconds to ensure complete privacy.
  • All tools work seamlessly inside Word, always within reach.
  • Create, refine, translate, summarize and secure documents effortlessly.
  • Improve grammar, clarity, and tone as you write in real time.
  • Rephrase and translate content with no layout or formatting changes.
  • Ask how to complete a task - like removing section breaks - and the AI will guide you or do it for you.
  • All tools work seamlessly inside Word, always within reach.
Learn more about Kutools for WordDownload Now
Kutools for Word features

Best Office Productivity Tools

Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!

πŸ€– Kutools AI Features: AI Assistant / Real-Time Assistant / Super Polish (Preserve Format) / Super Translate (Preserve Format) / AI Redaction / AI Proofread...

πŸ“˜ Document Mastery: Split Pages / Merge Documents / Export Selection in Various Formats (PDF/TXT/DOC/HTML...) / Batch Convert to PDF...

✏ Contents Editing: Batch Find and Replace across Multiple Files / Resize All Pictures / Transpose Table Rows and Columns / Convert Table to Text...

🧹 Effortless Clean: Sweap away Extra Spaces / Section Breaks / Text Boxes / Hyperlinks / For more removing tools, head to the Remove group...

βž• Creative Inserts: Insert Thousand Separators / Check Boxes / Radio Buttons / QR Code / Barcode / Multiple Pictures / Discover more in the Insert group...

πŸ” Precision Selections: Pinpoint Specific Pages / Tables / Shapes / Heading Paragraphs / Enhance navigation with more Select features...

⭐ Star Enhancements: Navigate to Any Location / Auto-Insert Repetitive Text / Toggle Between Document Windows / 11 Conversion Tools...

🌍 Supports 40+ Languages: Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Kutools for Word tabs on the ribbon
 
 

Office Tab - Brings Tabbed interface to Office, Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Free Download     Buy Now     Learn More
 

✨ Kutools for Office – One Installation, Five Powerful Tools!

Includes Office Tab Pro Β· Kutools for Excel Β· Kutools for Outlook Β· Kutools for Word Β· Kutools for PowerPoint

πŸ“¦ Get all 5 tools in one suite | πŸ”— Seamless integration with Microsoft Office | ⚑ Save time and boost productivity instantly

Best Office Productivity Tools

Kutools for Word - 100+ Tools for Word