How to read metadata information from docx documents?

what i need is to create a Word document template (docx) that will contain the title, author name, date, etc.

This template will then be used by users to complete it. I need to create a C # program that will take the docx file and read all the information of interest (name, name, date, ..).

So my questions are:

  • How to place metadata in a template: is it Title, is Date, is name, etc.? (not software)

  • How to programmatically read this information?

+5
source share
3 answers

- . Office , . "" Office.

. Office , .

, . , , , OpenXML, :

, , . , , , , .

, , , .docx .doct , , , "-" OpenXML; Word, docx. , , .

? : OpenXML

, OpenXML YouTube

+8

1) , : Title, , ..? ( )

"" MS Word 2010, :

How to set manually the MS Word document properties like Author, Title, etc ...

2) ?

( ), Openivity SDK 2.0 ( OpenXML SDK), , ( ), / / .

Open XML SDK 2.0 Productivity Tool

, : docx


:

, ,

, MSDN - Word 2010 Open XML SDK 2.0

, , .

+7

OpenXML , , , System.IO.Packaging. xml sdk #, PackageProperties. 11 , .

"" Word (DIP).

enter image description here , , . . , .

I wrote a quick application for Windows Form that displays this information using the open xdk xml call in the PackageProperties of the Word file that appears above.

enter image description here

Here is a complete solution with a sample word file included.

Hope this helps.

+5
source

All Articles