Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Leading Spaces in Document File Names.

Leading Spaces in Document File Names

Written by Allen Wyatt (last updated February 21, 2026)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365


6

Jo Ann would like to save Word documents using a space at the beginning of the file name. The leading space causes the file to be listed at the beginning of the Open dialog box, which Jo Ann finds helpful. However, she can't figure out how to get Word to pay attention to the desired space, as it is always automatically removed when she saves the file.

There are a couple of ways you can add the desired space. One is to rename the files using the command line in Windows. After you get out of Word, open a command line window, navigate to the folder where the file is saved, and then use a command such as the following:

ren MyFile.docx " MyFile.docx"

Note the use of the quote marks and the space after the first quote mark. The result is a leading space in your renamed file. The space appears in front of the file name even when you next start Word. It is the quote marks that make the operating system pay attention to the space.

If you don't want to resort to doing your renaming on the command line, then you might consider using a leading character different than a space. Good candidates are underscores, tildes, and plus signs. You can use these types of characters at the beginning of your file names right within Word, which makes them very convenient. Plus, they will sort just as Jo Ann wants within the Open dialog box.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11742) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Leading Spaces in Document File Names.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Tracing Errors

Sometimes it can be confusing to figure out the source of an error that is displayed in your worksheet. Excel provides a ...

Discover More

Declaring Variables

Macros depend on the use of variables to do their work. This tip examines how variables are declared in a macro, using ...

Discover More

Counting Cells Containing a Formula

Cells in a worksheet can contain different types of information, such as numbers, text, and formulas. If you want to ...

Discover More

Do More in Less Time! An easy-to-understand guide to the more advanced features available in the Microsoft 365 version of Word. Enhance the quality of your documents and boost productivity in any field with this in-depth resource. Complete your Word-related tasks more efficiently as you unlock lesser-known tools and learn to quickly access the features you need. Check out Microsoft 365 Word For Professionals For Dummies today!

More WordTips (ribbon)

Inserting Only Part of a File

You can easily insert one document within another document. What you may not know is that you can limit which part of a ...

Discover More

Jumping Around Folders

If you need to move between two different folders quite regularly in the Open dialog box, you'll find the technique ...

Discover More

Opening a Text File and Template from the Command Line

Word includes a command-line syntax that you can use to open files and do other operations. If you want to load a text ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 3 + 5?

2026-02-25 14:58:30

Tomek

As others have mentioned, adding a space at the start of the filename when using OneDrive is asking for trouble. I thought you can overcome this by using an unbreakable space (Alt+255, or Alt+0160) instead, but it causes different troubles. It may work on normal or networked drives, but probably would cause problems with other kinds of cloud storage.
I would also be careful with tilde characters as they are used by Windows for other purposes, e.g., as marker for the open file.


2026-02-24 13:45:19

Timothy J. McGowan

William, you may have given us the clue: I always press F12 for Save As. I've been using Windows since 3.11 (and DOS before that), and I simply cannot use the new file dialogs introduced in Office. If you use File, Save As, and then click Browse, you get the same (or very similar) dialog box as if you'd pressed F12 from the main document window; the difference lies in the number of steps it takes to get there.


2026-02-22 16:54:08

William

Timothy's suggestion works for me in Office 365 if I use Save As then Browse to get to the desired file location. You can then put quotation marks around the whole file name, including the extension, before you save it.


2026-02-22 14:17:03

Timothy J. McGowan

Huh. It worked for me today. Office 365-dot-current. For what it's worth, I have File Explorer set to always show file name extensions. And it should be worth even less to specify that I actually used two leading spaces, not one.

I returned here to note that when I finally closed the document, I did get an error message from OneDrive:

Rename 1 item? The name of a OneDrive item contains characters that prevent syncing. We can replace the characters with an underscore. For example, make sure the name doesn't begin or end with a space, end with a period, begin with two periods, or include any of these characters: \ / : * ? " < > |

(see Figure 1 below)

Figure 1. OneDrive error message


2026-02-22 13:25:09

Allen

Timothy,

I couldn't get that to work in Office 365. When I use Save As, I get a form where the file type is "static," based on the type of file you are trying to save. Thus, if it is a document, the "docx" is static and cannot be changed to something else. Thus, you cannot put a quote mark around the file type, which is necessary. In other words, you would need to use " MyFile.docx" with the quote marks around the leading space and after docx. However, Office 365 won't allow you to do that. The closest you can com is " MyFile" (because you cannot specify a file type), and it won't work because it is equivalent to " MyFile".docx.

In older versions of Word the approach you suggest would work just fine. I'm not sure when it stopped working, though.

-Allen


2026-02-22 12:26:32

Timothy J. McGowan

When saving the file in Word 365, just use the quotation marks: opening quotation mark, space, filename, closing quotation mark.

Note that in very limited experimenting, it seems that OneDrive cannot handle file names with leading spaces. Backup programs may fail as well. Given known issues with trailing spaces in file names, I would strongly recommend NOT using leading spaces either. Leading marks of punctuation will alpha sort before letters do.

Also note that if this naming convention is just to make it easier to find and reopen a recent document, you can instead sort the files by date rather than by name.


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.