To do this, you must first sharpen the tool. Let's first prepare the environment for developing Office Open XML.
Microsoft Office 2007
VS2005
Package Explorer
Are you ready? Let's take a look at Office 2007.
Create a new wordfile hello.docx. we try to modify the file name hello.docx.zip(add suffix .zip), and then use the decompression software (winrar). The composition of this document is exactly what we see. In the document. xml file in the word folder, we can see <w: t> Hello world! </W: t>, which is the text we entered in hello.docx. At this time, you will say that so many files constitute a docx file, which is not very large in size? Is it better than Word 2003? Don't worry, we found the volume of the hello.docx file very small, strange? In the past, Office2007 used the combination of XML and ZIP technology, so you don't have to worry about this. Obviously, the use of Open XML structure in Office2007 will bring qualitative changes to Office documents, while programmers will also have a new world.
Let's take a look at the security of Office 2007, if it still worries about the instability caused by VBA. We can see that the hello.docx file does not find any macro programming place. Fllow me, Save the hello.docx file as a file in the "enable macro docm" format, and then enable "development tools". Now we can go to VBA. Microsoft's ideas are really good at understanding people.
After practice, let's look back at the problems in practical application.
Question 1: How to Implement the Word documents created using the template of the company's unified Logo when the logo changes?
Question 2: What should I do if my superiors do not want others to see the comments of my employees?
These problems will be solved in Office 2007, and XML and ZIP technical features and industry advantages will be fully reflected.
Microsoft Open XML Development History
Ecma Office Open XML specification
Office Open XML document format
L core technology: Use the XML reference architecture and ZIP container
L storage method: each part of the document is stored separately to improve security
L use the Development Packaging conventions, which are also used by the XPS format
L The format is mainly applicable to Office Word 2007, Office Excel 2007, and Office PowerPoint 2007.
Office Open XML format Glossary
L a set of functions or methods used by APIs to access software functions
L The converter is used to enable and use it in previous Office versions.
L free tools for file creation in Office XML format
L The package contains the ZIP content of the components (parts) that constitute the document
Lserver,
L forward compatibility
L parts
L relationship
L Security
Document formats and Applications
L format description
L structured content format makes business processing more convenient
L The content can be used and manipulated through software
L The software can easily access information through interfaces.
L provides the following functions: Generation, organization,
L development, positioning, testing, collaboration, verification, computing, document protection,
L print information
L format can affect software design, and vice versa
XML reference architecture
XMLReference Architecture
L fixed format
L (bold, italic, table, paragraph, format ,...)
L document format
Custom Architecture
L basic data
L (e.g.: Price, invoice information)
L Business Information
Target of Office Open XML file format
L good versatility, not limited to a platform or developer
L new programming interfaces make operations easier
L reduce operation difficulty
-Interaction through programming
-Processing Method of the latest technology
-Comprehensive Solutions
-Data can be shared among multiple applications.
-Wide Application Scope
Open XML file in the developer's eyes
L ZIP file
L documentation
-XML section
-Binary
Link
-Relationship between Parts
L folding structure is only for convenience
Understanding OPC packages is a set of Parts and relation.
Download Demo source code: Hello World!