Working with document properties in Word And, in particular, knowing how to insert information such as the file name, path, or any other property into the document itself is an extremely useful skill for those looking to keep their files organized and professionally presented. Although at first glance it may seem like a basic function, Word offers numerous possibilities for automating, customizing, and making the most of these properties, both through the graphical interface and by using advanced field codes.
In this article I will explain absolutely everything you need to know about how to insert document properties in Word using the FileName field with the \p modifier (to display the full path), as well as other standard and custom properties, and their implications for collaborative environments, document management, or use in SharePoint. I'll also delve into the options available within Word itself and, for more advanced users, XML manipulation and the use of development SDKs. Let's get to it!
What are the properties of a Word document?
The document properties In Word, metadata consists of a series of metadata that describe the content and characteristics of the file. Key properties include title, author, keywords, comments, and creation or modification date. But Word allows you to go much further by adding custom properties that you can define yourself or that may be necessary in business and collaborative environments.
These properties are essential in document management, since facilitate the search, organization and classification of filesAdditionally, they can be used to automate information on covers, headers, or footers, ensuring that every time the document is opened or printed, it has the most up-to-date information, such as its location (full path), name, last modification date, etc.
Different types of properties in Word
To fully understand how to work with properties in Word and to take advantage of the possibilities of field codes like FileName, it is essential to distinguish between the following types of properties:
- Core properties: They are common to all Office programs and usually include the title, author, subject, category, keywords, and creation date, among others.
- Application-specific properties: These are, for example, those that belong only to Word, such as the number of pages, words, paragraphs, or template names.
- Custom Properties: These are those that the user (or an application) can define as desired, for example, to add the name of a reviewer responsible, an internal project code, status, etc.
- Properties derived from content types: In environments like SharePoint, you can define properties that depend on the type of document or specific content being managed.
These properties, in addition to being available through the Word graphical interface, They can be used dynamically within the document by inserting fields that reference their value, thus ensuring that any changes are automatically reflected in all parts of the document where that field appears.
How to insert document properties in Word using fields

Word has the so-called field codes, small snippets that allow you to embed variable information and automate tasks within your document. This way, you can display data like the file name, author, or print date right where you need it.
To insert, for example, the file name or its full path, the field code is used FileName together with the modifier \p:
- FileName: Inserts the name of the current file.
- FileName \p: Insert the full path where the file is saved, as well as its name.
The usual way to insert any property in Word using fields is:
- Go to the tab Insert and choose Header o Footer, depending on where you want to include the information.
- Choose edit header o edit footer.
- Click on quick elements and then select Field….
- In the list of field names, choose FileName (or the property you want: Date, Author, Title, etc.).
- Check the box Add path to file name if you want to include the full path (this adds the modifier \p automatically).
- Balance Accept and finish by editing the header or footer.
This information will always be kept up to date and will be modified when you save the document to another location or change the file name.
Insert other properties using fields in Word
The list of available fields is extensive. Some of the most useful properties you can insert are:
- Author: Displays the author of the document.
- Date: Prints the date (with configurable format).
- Title: Document title.
- LastSavedBy: Shows who last saved the file.
- DocProperty: Allows you to select any existing custom property.
From the same field insertion dialog box (Quick Parts > Field), you can choose the format you want or, if the field allows it, additional combinations of options.
Advanced Customization: Custom Properties
In addition to the standard properties, Word allows you to define custom properties from the document itself. This is especially useful in corporate contexts where you need to associate additional information with each file.
To create a custom property:
- Open the document in Word.
- Access the tab Archive and select Information.
- Click on Properties > Advanced Properties.
- Go to the tab Lessons.
- Enter the property name and value, select the type and press Add.
Once defined, You can insert these properties anywhere in the document using the DocProperty field. For example, when inserting the field DocPropertyYourPropertyName, the property value will be automatically reflected wherever you want.
This feature is vital for customizing templates, contracts, reports, or standardized documents that require variable fields depending on the client, project, edition, etc.
How properties are stored in Word files
Modern Word documents (. Docx) use the Office Open XML format, where all information associated with the document (including main, extended and custom properties) is stored in different sections of the compressed file.
The main properties (core properties) are stored in the node coreProperties with tags like dc:title, dc:creator, cp:keywords. For example: uterine
My Document Juan Pérez 4 2024-03-14T10:15:00Z
The specific properties of the program (extended properties) appear under the node Properties, including page count, template, company, word count, etc. For example:
5 2500 My Company SL
Custom properties (custom properties) are stored in their own section under custom-properties, with user-defined name and value:
Carlos López
All of this information can be viewed and even modified if you have advanced XML editing skills or develop solutions with the Open XML SDK.
Advanced Automation and Management: Using the Open XML SDK
For environments where automation is key, especially in companies that generate and manage large volumes of files, it's helpful to know how to programmatically interact with Word document properties. The Open XML SDK makes it easy to create, modify, and query custom properties using code.
For example, using the function SetCustomProperty (available in C# or VB), you can programmatically add or modify custom properties. The method typically requires:
- File name.
- Property name.
- Property value.
- Type (text, date, number, etc.).
The process involves opening the document in write mode, finding or creating the custom properties section, deleting the property if it already exists (to avoid type conflicts), adding the new property, and saving the document. It also takes care of maintaining the attribute. Pid sequentially, essential for the integrity of the XML file.
Thanks to this procedure, custom properties are perfectly accessible both from Word itself and from document management systems or third-party applications.
Interoperability and document management: integration with SharePoint

In corporate or educational environments, it is common to store documents on platforms such as SharePointWord document properties play a key role in document synchronization and management:
- When you edit properties from the Document Information Panel in Word, they appear as metadata columns in the SharePoint library.
- Any column-level changes in the library can be rolled down to the document as a new property.
- Core properties are usually synchronized, while some custom properties (e.g., content type identifiers) do not roll up to the library.
Additionally, for custom document types in SharePoint, the specific properties assigned to the content are stored in the section customXml and are automatically synchronized between the Word document and the library, facilitating management and traceability.
Additional options: embed and link files or use hyperlinks
Along with properties, Word allows insert internal and external hyperlinks, as well as embedded objects To add even more functionality to your documents:
- Internal hyperlinks: Using bookmarks, you can create jumps to specific sections of the document (ideal for long reports or manuals).
- External hyperlinks: They allow you to link to web pages, files on your computer, or relative paths.
- Embedded objects: You can insert entire files (PDFs, presentations, spreadsheets) as objects within the Word document itself, so they become part of the file and don't depend on external paths.
When using links to external files, it is recommended that all related files be saved in the same local folder or structure as the Word document., to ensure that the links work even if you copy the set to another computer.
As for hyperlinks, Word automatically creates placeholders for headings and subheadings if you use the predefined styles for Heading 1, Heading 2, etc., thus facilitating internal navigation.
Editing, deleting, and viewing fields and properties
Editing or deleting a field in Word is easy: just right-click on the field and choose the option you want (edit, update, delete). For hyperlinks, you can modify or delete them from the context menu. If you have inserted custom properties and want to update their value, do so from File > Information > Advanced Properties, and updates the fields with F9 to see the changes reflected in the document.
Similarly, you can show or hide field codes in the document using Alt + F9, which is useful if you need to manually review or modify commands.
Common questions and possible problems
Working with properties and links in Word can cause some problems if the related files are not managed properly. When moving documents to other computers, try to maintain the folder structure of linked files, and if possible, use relative paths. If you need maximum portability, consider embedding the files in Word (although this will increase the document size).
In collaborative contexts with multiple users editing documents, updating fields may require some attention to ensure all data reflects the latest changes. Also, remember that document metadata may contain sensitive information, so it's a good idea to review it before sharing a file externally.