Custom XML, embedded objects, linked files and template paths in a Word document
Last updated: 19 October 2026
Short answer: a .docx can carry data that is not on any page: custom XML parts written by add-ins or document systems, document variables written by macros, whole files embedded as objects, the full path of a linked source file, and the name or path of the template it was made from. Reading the pages does not show what is stored in these places; at most the page shows a field result, the text of a content control or a picture of an object. Find them with Document Inspector or by looking inside a copy of the file, and take each one out before you send it.
This page covers the less familiar places. Properties, comments and tracked changes have their own guides: the author's name in Word, comments, ink and annotations and tracked changes. The overview of every kind is the types of hidden data in Office files.
At a glance
| What | What it can hold | Where in the .docx |
|---|---|---|
| Custom XML parts | data in an add-in's or a system's own format: a client or case reference, a workflow status, the values behind content controls | customXml/item1.xml and the like, with a properties part beside each |
| Custom XML and smart tag markup | element names and attributes wrapped around ordinary text, in older or generated files | inside word/document.xml |
| Document variables | names and values a macro or add-in stored | w:docVars in word/settings.xml |
| Embedded objects | a whole workbook, presentation or other file, with its own contents and properties | word/embeddings/ |
| Linked objects and fields | the full path of the source file, which can include a user name, a server and folder names | an external relationship in word/_rels/document.xml.rels, or a field such as LINK or INCLUDETEXT |
| Template | the template's name, and the path of the attached template | Template in docProps/app.xml; an external relationship from word/settings.xml |
Custom XML parts
Microsoft describes a custom XML part as XML data embedded in a document: "documents can also contain custom XML parts, which you can use to store arbitrary XML data in the documents" (Custom XML parts overview). Add-ins, templates and document management systems use them to keep their own data with the file. A content control can be bound to an element in such a part, so the text in the control and the value in the part stay the same; the part can also hold values no control shows.
Because the vocabulary is whoever wrote it, there is no fixed list of what a part may contain. In practice it is often a reference number, a client or matter name, a classification, a status or a person's name. Separately, older files and files generated by other software can carry custom XML or smart tag markup in the text itself, with element names and attribute values around ordinary words. For Word 2016 and later, Microsoft says "when you open a document containing custom XML markup, Word removes it from the document" (Custom XML markup in Word), so it matters most in files that have not been opened and saved in Word since. Custom XML parts, above, are a separate feature.
Document Inspector lists custom XML data for Word: Microsoft says "the Document Inspector can find and remove this XML data" (Remove hidden data and personal information by inspecting documents). If a content control is bound to the data, removing the part leaves the text the control shows.
Document variables
Document variables are names and values kept in the document's settings. Microsoft's reference for macros says they "are used to preserve macro settings in between macro sessions" (Variables object (Word)). Word has no ordinary command that lists them: they are written and read by macros and add-ins, and a DOCVARIABLE field shows one on the page. A template that fills in a letter can leave the values it used, such as a name or a reference, in the variables of every document made from it.
Embedded objects
An object inserted with Insert › Object, or pasted as an embedded workbook or slide, becomes part of the document. Microsoft puts it this way: "Embedded objects become part of the Word file and, after they are inserted, they are no longer part of the source file" (Linked objects and embedded objects). The page shows a picture of part of the object, but the whole file is inside: every sheet of an embedded workbook, hidden ones too, with its own properties and comments.
Microsoft's Document Inspector page lists no embedded files or objects for Word. For Excel and PowerPoint it lists them among the items it finds but can't remove. Where the program it came from is installed, opening the object (double-click it) on a copy of the document shows what it holds; look there for hidden sheets, comments and properties as well.
Linked objects and fields that name another file
A linked object keeps its data in the source file. Microsoft: "The Word file, or destination file, stores only the location of the source file". That location can be a full path, a relative path or an address, and a full path often names the person who saved the file (C:\Users\…), a server or share, and the folders on the way, which can name clients or projects. Fields such as LINK, INCLUDETEXT and INCLUDEPICTURE keep a path in the same way. A linked picture keeps the path of the picture file.
In Word for Windows, File › Info › Edit Links to Files lists the links when there are any. Breaking a link drops the path; Microsoft's PowerPoint page notes that after Break Link "the content will still appear in the slide, but it will be embedded in the presentation instead of linked" (Update or remove a broken link to an external file). So a broken link can turn into an embedded copy of the data, which then needs checking as above.
The template's name and path
A document can record a template's name in its properties (Microsoft lists "Template name" among the Word items Document Inspector covers). It can also have an attached template, which Word records as a relationship to the template file; when the template sits on a network share or in a personal folder, that relationship holds its full path. A template called after a client, or kept in a folder named after one, can say where the document came from, though neither value proves its origin.
In Word for Windows, File › Info › Properties › Advanced Properties shows the template's name on the Summary tab, and Developer › Document Template shows the attached template.
Check a copy yourself
- Make a copy of the document and change its extension from .docx to .zip. Open the zip.
- A
customXmlfolder means there are custom XML parts. Open eachitemfile as text and read it. - Open
word/settings.xmland search fordocVar(document variables) andattachedTemplate. - Look in
word/embeddings: each file there is an embedded object. They are not text. Some are ordinary files, others are OLE containers that need the program they came from; opening the object from a copy of the document is usually simpler. - Open the files in
word/_relsand search forExternal. Each match is a link that leaves the file, with the path or address inTarget; ordinary web links are among them. - Open
docProps/app.xmland look atTemplate. - Search
word/document.xml, and the header and footer parts beside it, forINCLUDETEXT,INCLUDEPICTUREandLINKto find fields that name another file. A field's words can be split across several XML elements, and a plain search misses those.
Finding nothing this way shows only that these searches found nothing; it does not show that the file holds nothing else.
Take them out in Word
- Work on a copy made for sending.
- Run Document Inspector (File › Info › Check for Issues › Inspect Document) and remove custom XML data and document properties.
- For each embedded object, decide whether the reader needs the file or only what it shows. If only what it shows, delete the object and paste a picture of it instead.
- In Edit Links to Files, break each link you do not need, then check what the object holds now. For fields, select the field and unlink it (Ctrl+Shift+F9) so the shown text stays and the path goes.
- If the attached template's path names a person, a client or a server, attach a template kept in a neutral place (Developer › Document Template), then look in
word/_rels/settings.xml.relsof a copy again. - Document variables have no command in Word; remove them with a macro, or with a tool that removes them.
What ScrubDrop does
ScrubDrop reads .docx, .xlsx and .pptx files in your browser; the file is not uploaded. It lists custom XML parts and markup, document variables, content-control bindings, embedded objects, links to other files and the attached template, along with the template name in the properties, for free. The free version removes document properties, including the template name, together with comments and tracked changes (by accepting them), one file at a time. ScrubDrop Pro removes custom XML, document variables and bindings, embedded objects and links to other files, including the attached template. An embedded object leaves the picture that was showing, and a field that named another file or read a removed variable leaves the text it showed. Some fields it cannot take apart, and those files are refused with a message rather than guessed at. The result is read again by software separate from the one that wrote it, and a file that does not pass is not offered.
Questions
Does Document Inspector remove embedded objects from a Word document?
Microsoft's Document Inspector page does not list embedded files or objects among the items it inspects in Word; for Excel and PowerPoint it lists them among the items it finds but can't remove. Delete the object in Word, or replace it with a picture of what it shows.
If I break a link to a file, is the path gone?
The path to the source goes, but in PowerPoint Microsoft says the content is then embedded instead of linked, so a copy of the source's data can now be inside the file. Check what the object holds after breaking the link, or replace it with a picture.
Does saving as PDF leave custom XML and embedded objects behind?
A PDF carries the page as it looks, so the picture of an embedded object and the text a content control shows go with it. Whether anything else goes with it depends on the export options and the program; check the PDF's properties and pages before sending it.
Sources: the Microsoft pages linked on this page were checked on 19 October 2026.
See what a .docx keeps out of sight, in your browser. Free: one file at a time; the supported kinds of hidden data it finds are listed, and properties, comments and tracked changes are removed. Check a file.