---
title: "DOCX"
language: "en"
type: "Format"
summary: "Registered MIME type: application/vnd.openxmlformats-officedocument.wordprocessingml.document"
keywords: 
- Microsoft word
- doc
- docx
- document
- Microsoft document
- Microsoft office
- Google docs
- LibreOffice
- Pages
- Office Open XML
- OOXML_2012
- WordprocessingML
canonical_url: "https://reference.wolfram.com/language/ref/format/DOCX.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Document Formats"
    link: "https://reference.wolfram.com/language/guide/DocumentFormats.en.md"
  - 
    title: "Importing & Exporting"
    link: "https://reference.wolfram.com/language/guide/ImportingAndExporting.en.md"
  - 
    title: "Importing & Exporting in Notebooks"
    link: "https://reference.wolfram.com/language/guide/ImportingAndExportingInNotebooks.en.md"
  - 
    title: "Listing of All Formats"
    link: "https://reference.wolfram.com/language/guide/ListingOfAllFormats.en.md"
  - 
    title: "Processing Textual Data"
    link: "https://reference.wolfram.com/language/guide/ProcessingTextualData.en.md"
related_tutorials: 
  - 
    title: "Importing & Exporting"
    link: "https://reference.wolfram.com/language/tutorial/ImportingAndExporting.en.md"
---
# DOCX (.docx, .docm)

``Import`` is fully compatible with the Word 2007 standard.

## Background & Context

* Registered MIME type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
* Microsoft Word document file.
* Standard format of Microsoft Word 2007 and higher.
* Also known as Office Open XML document.
* XML-based file bundle.
* Stores text, tables and graphics.

## Import

``Import["file.docx"]`` imports a DOCX file as a string.

``Import["file.docx", elements]`` imports the specified elements.

The import format can be specified with ``Import["file", "DOCX"]`` or ``Import["file", {"DOCX", elem, …}]``.

---

See the following reference pages for full general information:

|                 |                            |
| --------------- | -------------------------- |
| Import          | import from a file         |
| CloudImport     | import from a cloud object |
| ImportString    | import from a string       |
| ImportByteArray | import from a byte array   |

## Import Elements

General ``Import`` elements:

|             |                                                     |
| ----------- | --------------------------------------------------- |
| "Elements"  | list of elements and options available in this file |
| "Summary"   | summary of the file                                 |
| "Rules"     | list of rules for all available elements            |

---

Data representation elements:

|                 |                                                           |
| --------------- | --------------------------------------------------------- |
| "Plaintext"     | a string giving the textual content of the whole document |
| "FormattedText" | a sequence of formatted text for the whole document       |

Embedded media elements:

|                      |                                          |
| -------------------- | ---------------------------------------- |
| "EmbeddedImageNames" | a list of image file names in the bundle |
| "EmbeddedImages"     | a list of embedded images                |

Metadata elements:

|                      |                                                          |
| -------------------- | -------------------------------------------------------- |
| "CreationDate"       | creation date of the document, given as a DateObject     |
| "Creator"            | program that created the content                         |
| "Description"        | document description                                     |
| "Language"           | document language                                        |
| "LastModifiedBy"     | author who last modified the file                        |
| "ModificationDate"   | modification date of the document, given as a DateObject |
| "RawMetaInformation" | metadata given as strings and date objects               |
| "RevisionNumber"     | number of times the document has been saved              |
| "Subject"            | the subject of the document                              |
| "Title"              | document title                                           |

---

## Examples (19)

### Basic Examples (2)

Import a DOCX file:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx"]//IconizedObject[«Pane»]

Out[1]=
"Jabberwocky

By Lewis Carroll

’Twas brillig, and the slithy toves 
Did gyre and gimble in the wabe: 
All mimsy were the borogoves, 
And the mome raths outgrabe. 

“Beware the Jabberwock, my son! 
The jaws that bite, the claws that catch! 
Beware  ... n the Jabberwock? 
Come to my arms, my beamish boy! 
O frabjous day! Callooh! Callay!” 
He chortled in his joy. 

’Twas brillig, and the slithy toves 
Did gyre and gimble in the wabe: 
All mimsy were the borogoves, 
And the mome raths outgrabe.

"
```

---

Import summary of a DOCX file:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "Summary"]

Out[1]= DynamicModule[«6»]
```

### Scope (2)

#### Import (2)

Import a plain test from a DOCX file:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx"]//IconizedObject[«Pane»]

Out[1]=
"Jabberwocky

By Lewis Carroll

’Twas brillig, and the slithy toves 
Did gyre and gimble in the wabe: 
All mimsy were the borogoves, 
And the mome raths outgrabe. 

“Beware the Jabberwock, my son! 
The jaws that bite, the claws that catch! 
Beware  ... n the Jabberwock? 
Come to my arms, my beamish boy! 
O frabjous day! Callooh! Callay!” 
He chortled in his joy. 

’Twas brillig, and the slithy toves 
Did gyre and gimble in the wabe: 
All mimsy were the borogoves, 
And the mome raths outgrabe.

"
```

---

Import some metadata:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", {{"Description", "Language", "CreationDate"}}]

Out[1]= {"A famous nonsense poem written by Lewis Carroll.", "en-GB", DateObject[{2018, 3, 7, 7, 15, 1.}, "Instant", "Gregorian", None]}
```

### Import Elements (15)

#### Available Elements (1)

List of available elements:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "Elements"]

Out[1]= {"CreationDate", "Creator", "Description", "EmbeddedImageNames", "EmbeddedImages", "FormattedText", "Language", "LastModifiedBy", "ModificationDate", "Plaintext", "RawMetaInformation", "RevisionNumber", "Subject", "Summary", "Title"}
```

#### Data Representation (2)

##### "Plaintext" (1)

---

Import the text from the whole document:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "Plaintext"]//IconizedObject[«Pane»]

Out[1]=
"Jabberwocky

By Lewis Carroll

’Twas brillig, and the slithy toves 
Did gyre and gimble in the wabe: 
All mimsy were the borogoves, 
And the mome raths outgrabe. 

“Beware the Jabberwock, my son! 
The jaws that bite, the claws that catch! 
Beware  ... n the Jabberwock? 
Come to my arms, my beamish boy! 
O frabjous day! Callooh! Callay!” 
He chortled in his joy. 

’Twas brillig, and the slithy toves 
Did gyre and gimble in the wabe: 
All mimsy were the borogoves, 
And the mome raths outgrabe.

"
```

##### "FormattedText" (1)

---

Import formatted text from the whole document:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "FormattedText"]//IconizedObject[«Pane»]

Out[1]=
**"Jabberwocky"**"
""""
"**"BY LEWIS CARROLL"**"
"**""**"
"**""**"
""’""Twas brillig, and the slithy toves ""
""Did gyre and gimble in the wabe: ""
""All mimsy were the borogoves, ""
""And the mome raths outgrabe. ""
""""
""“""Beware the Jabberwock ... y! ""
""O frabjous day! Callooh! Callay!""” ""
""He chortled in his joy. ""
""""
""’""Twas brillig, and the slithy toves ""
""Did gyre and gimble in the wabe: ""
""All mimsy were the borogoves, ""
""And the mome raths outgrabe.""
""""
""
""""
""
"
```

#### Embedded Media Elements (2)

##### "EmbeddedImageNames" (1)

---

Import the names of embedded images:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "EmbeddedImageNames"]

Out[1]= {"image1.jpeg", "image2.jpeg"}
```

##### "EmbeddedImage" (1)

---

Import embedded images:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "EmbeddedImages"]

Out[1]= {[image], [image]}
```

#### Metadata (10)

##### "CreationDate" (1)

---

Import the creation date of the document:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "CreationDate"]

Out[1]= DateObject[{2018, 3, 7, 7, 15, 1.}, "Instant", "Gregorian", None]
```

##### "Creator" (1)

---

Import the creator of the document:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "Creator"]

Out[1]= "Microsoft Office User"
```

##### "Description" (1)

---

Import the description of the document:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "Description"]

Out[1]= "A famous nonsense poem written by Lewis Carroll."
```

##### "Language" (1)

---

Import the language of the document:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "Language"]

Out[1]= "en-GB"
```

##### "LastModifiedBy" (1)

---

Import the author who last modified the file :

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "LastModifiedBy"]

Out[1]= "Lewis Carroll"
```

##### "ModificationDate" (1)

---

Import the modification date of the document:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "ModificationDate"]

Out[1]= DateObject[{2023, 10, 2, 11, 42, 28.}, "Instant", "Gregorian", None]
```

##### "RawMetaInformation" (1)

---

Import metadata from the file :

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "RawMetaInformation"]

Out[1]= <|"CreationDate" -> DateObject[{2018, 3, 7, 7, 15, 1.}, "Instant", "Gregorian", None], "Creator" -> "Microsoft Office User", "Description" -> "A famous nonsense poem written by Lewis Carroll.", "Language" -> "en-GB", "LastModifiedBy" -> "Lewis Carroll", "ModificationDate" -> DateObject[{2023, 10, 2, 11, 42, 28.}, "Instant", "Gregorian", None], "RevisionNumber" -> "2", "Subject" -> "Nonsense poem", "Title" -> "Jabberwocky"|>
```

##### "RevisionNumber" (1)

---

Import the revision number:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "RevisionNumber"]

Out[1]= "2"
```

##### "Subject" (1)

---

Import the subject of the document:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "Subject"]

Out[1]= "Nonsense poem"
```

##### "Title" (1)

---

Import the title of the document:

```wl
In[1]:= Import["ExampleData/Jabberwocky.docx", "Title"]

Out[1]= "Jabberwocky"
```

## See Also

* [`Import`](https://reference.wolfram.com/language/ref/Import.en.md)
* [`CloudImport`](https://reference.wolfram.com/language/ref/CloudImport.en.md)
* [`XLSX`](https://reference.wolfram.com/language/ref/format/XLSX.en.md)
* [`PDF`](https://reference.wolfram.com/language/ref/format/PDF.en.md)
* [`MOBI`](https://reference.wolfram.com/language/ref/format/MOBI.en.md)
* [`HTML`](https://reference.wolfram.com/language/ref/format/HTML.en.md)
* [`EPS`](https://reference.wolfram.com/language/ref/format/EPS.en.md)
* [`TeX`](https://reference.wolfram.com/language/ref/format/TeX.en.md)
* [`LaTeX`](https://reference.wolfram.com/language/ref/format/LaTeX.en.md)
* [`NB`](https://reference.wolfram.com/language/ref/format/NB.en.md)
* [`CDF`](https://reference.wolfram.com/language/ref/format/CDF.en.md)

## Tech Notes

* [Importing & Exporting](https://reference.wolfram.com/language/tutorial/ImportingAndExporting.en.md)

## Related Guides

* [Document Formats](https://reference.wolfram.com/language/guide/DocumentFormats.en.md)
* [Importing & Exporting](https://reference.wolfram.com/language/guide/ImportingAndExporting.en.md)
* [Importing & Exporting in Notebooks](https://reference.wolfram.com/language/guide/ImportingAndExportingInNotebooks.en.md)
* [Listing of All Formats](https://reference.wolfram.com/language/guide/ListingOfAllFormats.en.md)
* [Processing Textual Data](https://reference.wolfram.com/language/guide/ProcessingTextualData.en.md)

## History

* [Introduced in 2024 (14.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn140.en.md)