Extract Metadata from DOTX File in C#

Read & Extract metadata information from a wide range of documents, images, audio & video formats using GroupDocs.Metadata for .NET API.


Download Free Trial

About GroupDocs.Metadata for .NET API

GroupDocs.Metadata for .NET offers an advanced set of metadata management and manipulation features, allowing developers to easily read, edit, remove, search, compare, replace and export metadata information from images and document formats without using any external software. Extract metadata details from PDF, Word, Excel, PowerPoint, Outlook, OneNote, Visio, Project, AutoCAD, Archive and Multimedia file formats, and perform supported metadata operations with true flexibility.

Steps for DOTX Metadata Extraction in C#

GroupDocs.Metadata makes it easy for .NET developers to read and extract metadata information from DOTX files from within their applications by implementing a few easy steps.

  • Load the DOTX with an instance of Metadata class.
  • Make up a predicate to examine all metadata properties.
  • Pass the predicate to the FindProperties method.
  • Iterate through the found properties.

System Requirements

GroupDocs.Metadata for .NET APIs are supported on all major platforms and operating systems. Before executing the code below, please make sure that you have the following prerequisites installed on your system.

  • Operating Systems: Microsoft Windows, Linux, MacOS
  • Development Environments: Visual Studio, Xamarin, MonoDevelop
  • Frameworks: .NET Framework, .NET Standard, .NET Core, Mono
  • Download the latest version of GroupDocs.Metadata for .NET from NuGet

using (var metadata = new GroupDocs.Metadata.Metadata("input.dotx"))
{
	// extract all metadata properties that fall into a particular category
	var properties = metadata.FindProperties(
		p => p.Tags.Any(t => t.Category == GroupDocs.Metadata.Tagging.Tags.Content));

	// iterate over all properties and display
	foreach (var property in properties)
	{
		Console.WriteLine("{0} = {1}", property.Name, property.Value);
	}

	// extract all properties having a specific type and value
	var year = DateTime.Today.Year;
	properties = metadata.FindProperties(
		p => p.Value.Type == GroupDocs.Metadata.Common.MetadataPropertyType.DateTime &&
		p.Value.ToStruct(DateTime.MinValue).Year == year);

	// display all datetime properties with the year value equal to the current year
	foreach (var property in properties)
	{
		Console.WriteLine("{0} = {1}", property.Name, property.Value);
	}

	// extract all properties having names matching the specified regex
	const string pattern = "^author|company|(.+date.*)$";
	var regex = new System.Text.RegularExpressions.Regex(pattern,
		System.Text.RegularExpressions.RegexOptions.IgnoreCase);
	properties = metadata.FindProperties(p => regex.IsMatch(p.Name));

	// display properties whose names match the following pattern
	foreach (var property in properties)
	{
		Console.WriteLine("{0} = {1}", property.Name, property.Value);
	}
}

Metadata Extraction Live Demos

Retrieve metadata information of DOTX file right now by visiting GroupDocs.Metadata Live Demos website.
The live demo has the following benefits

No need to download API

No need to write any code

Just upload the source file

Get download link to save the file

About DOTX File Format

Files with DOTX extension are template files created by Microsoft Word to have pre-formatted settings for generation of further DOCX files. A template file is created in order to have specific user settings that should be applied to subsequent flies created from these. These settings include page margins, borders, headers, footers, and other page settings. Such templates are used in official documents such as company letterheads and standardized forms. The DOTX file format was introduced with the release of Microsoft Office 2007 to replace the binary DOT file format, but is supported by higher versions as well. Microsoft Word by default opens every new document based on normal.dot file. If modified, all the new files created will result in same settings as from the template file. In Microsoft Word 2007, the DOT file format has been replaced with Office OpenXML based DOTX file format.

Read More About DOTX File Format

Reading & Extracting Other File Formats

Multi format documents and images metadata extraction API for .NET. Retrieve metadata of some of the popular file formats as stated below.

Extract PDF Metadata

(Adobe Portable Document Format)

Extract DOC Metadata

(Microsoft Word Document)

Extract DOCM Metadata

(Microsoft Word Macro-Enabled Document)

Extract DOCX Metadata

(Microsoft Word Open XML Document)

Extract DOT Metadata

(Microsoft Word Document Template)

Extract DOTX Metadata

(Word Open XML Document Template)

Extract XLS Metadata

(Microsoft Excel Binary File Format)

Extract XLSX Metadata

(Microsoft Excel Open XML Spreadsheet)

Extract XLSM Metadata

(Microsoft Excel Macro-Enabled Spreadsheet)

Extract XLTM Metadata

(OOXML Macro Enabled Workbook Template)

Extract PPT Metadata

(PowerPoint Presentation)

Extract PPS Metadata

(Microsoft PowerPoint Slide Show)

Extract PPTX Metadata

(PowerPoint Open XML Presentation)

Extract PPSX Metadata

(PowerPoint Open XML Slide Show)

Extract POTX Metadata

(Microsoft PowerPoint Open XML Template)

Extract POTM Metadata

(Microsoft PowerPoint Template)

Extract PPTM Metadata

(Microsoft PowerPoint Presentation)

Extract PPSM Metadata

(Microsoft PowerPoint Slide Show)

Extract ODS Metadata

(Open Document Spreadsheet)

Extract ODT Metadata

(Open Document Text)

Extract TIFF Metadata

(Tagged Image File Format)

Extract PNG Metadata

(Portable Network Graphic)

Extract GIF Metadata

(Graphical Interchange Format File)

Extract BMP Metadata

(Bitmap File Format)

Extract JP2 Metadata

(JPEG 2000 Core Image File)

Extract WEBP Metadata

(Raster Web Image File Format)

Extract PSD Metadata

(Adobe Photoshop Document)

Extract WMF Metadata

(Windows Metafile)

Extract EMF Metadata

(Enhanced Metafile Format)

Extract MPP Metadata

(Microsoft Project Document)

Extract MSG Metadata

(Microsoft Outlook E-mail Message)

Extract EML Metadata

(E-mail Message)

Extract DWG Metadata

(Autodesk Design Data Formats)

Extract DXF Metadata

(AutoCAD Drawing Interchange)

Extract ONE Metadata

(Microsoft OneNote)

Extract MP3 Metadata

(MPEG Audio Layer III)

Extract WAV Metadata

(Waveform Audio File Format)

Extract DICOM Metadata

(Digital Imaging & Comm in Medicine)

Extract AVI Metadata

(Audio Video Interleave File)

Extract VSD Metadata

(Microsoft Visio 2003-2010 Drawing)

Extract VSDX Metadata

(Microsoft Visio Drawing)

Extract VSS Metadata

(Microsoft Visio 2003-2010 Stencil)

Extract VDX Metadata

(Microsoft Visio 2003-2010 XML Drawing)

Extract VSX Metadata

(Microsoft Visio 2003-2010 XML Stencil)

Extract ZIP Metadata

(Archive File Format)

Extract EPUB Metadata

(Digital E-Book File Format)

Extract VCF Metadata

(Electronic Business Card)

Back to top
 English