Learn about file formats
A file format specifies how data is stored for a particular application. For example, a .docx file is an Open XML formatted Microsoft Word document. Not all applications can read all file format; and in some cases an application may only be able to read parts of the file. For example, a application may be able to read the text, but not the formatting, of a file that uses a format other than its own.
OpenDocument Format (ODF) was originally developed to support the features and behavior of OpenOffice-based productivity suites and Open XML was originally developed to support the features and behavior of Microsoft Office.
Microsoft Office now provides support for ODF and gives people using Microsoft Office the chance to save their Office files in ODF. However, because Microsoft Office and OpenOffice features aren’t exactly the same or aren’t implemented the same way, people who use unsupported features and save Office files in ODF might experience changes in how they can work with the file and sometimes see a loss of content.
The Open XML format (.docx/.xlsx/.pptx) is the default format in all supported versions of Microsoft Office and, unless you have a specific reason to use a different format, it's the format we recommend using for your Office files.
To learn more about the Open Document Format (ODF) generally see OASIS Open Document Format for Office Applications .
Learn more about the differences in file formats
Differences between the OpenDocument Spreadsheet (.ods) format and the Excel (.xlsx) format
Differences between the OpenDocument Presentation (.odp) format and the PowerPoint (.pptx) format
Differences between the OpenDocument Text (.odt) format and the Word (.docx) format
Need more help?
Want more options.
Explore subscription benefits, browse training courses, learn how to secure your device, and more.
Microsoft 365 subscription benefits
Microsoft 365 training
Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.
Ask the Microsoft Community
Microsoft Tech Community
Microsoft 365 Insiders
Find solutions to common problems or get help from a support agent.
Was this information helpful?
Thank you for your feedback.
Maximize the everyday with Microsoft 365
The Microsoft Office Open XML Format -- Preview for Developers
Important! Selecting a language below will dynamically change the complete page content to that language.
Supported Operating Systems
Apple Mac OS X, Linux, Windows 2000, Windows 3.1, Windows 3.11, Windows 95, Windows 98, Windows 98 Second Edition, Windows CE, Windows CE .NET, Windows ME, Windows NT, Windows NT Embedded , Windows Server 2003, Windows Small Business Server 2003 , Windows Vista, Windows XP
- Animation and Timing
- Custom Shows
- Presentation Properties
- View Properties
- Audio and Video
- Slide Master
- Slide Layout
- Notes Master
- Notes Slide
- Handout Master
- Headers and Footers
- Fill, Fonts, Outines, Effects
- Text Styles
- Color Scheme
- Slide Number
PresentationML Slides - Properties - Color Scheme
The colors used on a slide begin with the theme part for the presentation. Within the <a:themeElements> element of the theme part is a <a:clrScheme> element. The color scheme of a theme defines 12 colors: 2 dark colors ( <a:dk1> and <a:dk2> ), 2 light colors ( <a:lt1> and <a:lt2> ), 6 accent colors ( <a:accent1 through accent6> ), and a color for hyperlinks ( <a:hlink> ) and a color for followed hyperlinks ( <a:folHlink> ). Each of the colors may be defined by any of the methods for specifying color. See Defining Colors , below. The color scheme may also have a name attribute ( <a:clrScheme name="Flow"> ) which shows up on the user interface, typically corresponding to the name of the theme.
The colors defined in this theme color scheme are then mapped to the colors to be used for background, text, and accents in slides. This mapping first occurs at the slide, handout, or notes master level using the <p:clrMap> , an empty element, which is a child of the root master element (e.g., <p:sldMaster> element). The color scheme is mappped using attributes of <p:clrMap> corresponding to the 12 colors. For example, below is a color scheme defined in the theme part, followed by a mapping in a master slide.
The color map within the master slide is below. For example, the first text color is mapped to dk1 in the theme, or <a:sysClr val="windowText" lastClr="000000"/> ; the second background color is mapped to lt2 in the theme, or <a:srgbClr val="DBF5F9"/> .
If we alter the mapping in the master slide so that the first background color is mapped to accent4 instead of lt1 (i.e., bg1="accent4" ), we get the slide as shown below. The background is now changed to the accent4 color because the background color in the master slide was set to <a:schemeClr val="bg1"/>
These color mappings found within the master slides can be overridden withing a slide layout or a slide using <p:clrMapOvr> , which is a child of <p:sld> , <p:sldLayout> , or <p:notes> . The <p:clrMapOvr> element can have one of two children: <a:masterClrMapping> or <a:overrideClrMapping> . (Note the different namespace for the children - in the main drawingML namespace.) When <a:masterClrMapping /> (an empty element without attributes) is specified, the color scheme defined in the master slide is used. Alternatively, the <a:overrideClrMapping> can be specified just as the <a:clrMap> , mapping text, background, and accent colors to theme colors using attributes. For example, suppose we start with a title slide in the Flow theme using the following color map in the master slide:
If we specify <a:masterClrMapping /> within the <p:clrMapOvr> of the slide, we get the following slide:
Now, specify an override in the slide reversing the bg1 and accent1 colors so that accent1 is assigned to the bg1 color and lt1 to the accent1 color:
This change yields the following result to the slide:
Colors are specified at potentially many points within an OOXML document. Within wordprocessingML documents, colors are specified as an RGB value or as a theme color value. For example, the color of a run of text can be specified as an RBG value with a <w:color w:val="FFFF00"/> within the run properties, or as a theme color with a <w:color w:themeColor="accent2"/> . The border of a table is specified as an attribute of the border: E.g., <w:top w:val="single" w:sz="12" w:space="0" w:color="FF0000"/> or <w:top w:val="single" w:sz="12" w:space="0" w:color="accent2"/> .
Colors are specified in a spreadsheetML document as they are in wordprocessingML documents; either as an rbg value or by referencing a theme color. For example, the foreground color of a cell can be specifed with a <fgColor rgb="FFFFFF00"/> within a <patternFill> element, or text within a cell can be assigned a theme color with a <color theme="1"/> within the run properties element, which uses an index into the <clrScheme/> of the theme part.
In drawingML (which includes themes), and consequently in presentationML documents, there are 6 different ways to specify color, and they correspond to 6 different elements.
- as a preset color ( <a:prstClr val="black"/> ). See ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference at 126.96.36.199 for the complete list of enumerated values.
These elements corresponding to color specification methods can also have child elements which transform the base color. So, for example, in the sample below, a scheme or theme color is specified as accent6, but a luminance modulation is applied to that base color.
Color Placeholders within Themes
Note how placeholders for colors are used within themes. For example, a theme may define a solid fill as shown below, using a "phClr" or placeholder for the value. This means that the fill will use the color specified as supplied when the theme fill style is referenced. Assume the following appears in the theme.
This fill may be referenced in a shape with the <p:style> element, using the idx attribute of the <a:fillRef> element within the style. The <a:fillRef> specifies a theme color with a child <a:schemeClr> element. Below the accent2 color is specified as the color to be used in place of the placeholder in the theme.
This seems needlessly obtuse in this example. However, recall that the specification of the <a:schemeClr> element within the theme may specify many different effects and alterations to the color (as child elements), so the color may be only one component of the overall fill appearance.
PresentationML is the XML format used by Microsoft PowerPoint 2007 and that is part of the Office Open XML specification. It defines all the structure for the presentation related data. Pure graphic data (ie the content of the slide) is described using DrawingML .
- 1 Finding sample files
- 2.1.1 Importer
- 2.1.2 Slides
- 2.1.3 XModel
- 188.8.131.52 Transitions
- 184.108.40.206 Timing
- 220.127.116.11 Shape Animations
- 18.104.22.168 Limitations
- 3.1 Open Issues
Finding sample files
Use google and look for "download pptx".
oox/source/ppt/ contain the PresentationML specific code for the importer as well as dealing with presentation specific data.
oox/source/drawingml is for DrawingML . Most of the slide content is actually DrawingML .
The importer is the class PowerPointImport.
The actual slide that is imported
Storing every theme that is used so far, the theme is imported before the slide.
Map of the Animation nodes by idea. (already change to class SlidePersist)
Access to every page loaded so far.
Master pages and notes.
SlidePersist is the class that contain the slide data, including reference to the associated theme and color scheme. It can be a slide, a master slide, note page or handout master.
(the corresponding page where the shapes are to be inserted)
(the actual theme that is used for this page)
(the local color scheme (if any))
This is the masterpage of this slide, it is only set if this slide is not a master by itself
so when importing a shape, we have access to the corresponding theme and text styles.
See DrawingML for more information.
The objects itself are created in SlideFragmentHandler::~SlideFragmentHandler
See XModel .
Animation are heavily based on SMIL , much like the internals of Impress. There are 3 parts: slide transition, slide timing and shape animations
Transition in OOx and OpenDocument are not exactly the same but there is almost a 1 to 1 mapping. They are both based on SMIL transitions. See also: http://www.w3.org/TR/2005/REC-SMIL2-20050107/smil-transitions.html#Table%201:%20Taxonomy%20Table
- ID : the XML token
- OOo Status : Y es or N o.
- Type : the type as defined in com/sun/star/animations/TransitionType.hpp
- SubType : the type as defined in com/sun/star/animations/TransitionSubType.hpp
There are also some limitations: OOo does not seem to support "stopping sound". Neither does it support embedded sound (see below).
Office Open XML specify that sound can be embedded in the file (in the container) and use relationships to refer to it. Unfortunately as of today OpenOffice is unable to do so. To that effect sounds are copied in the gallery and opened from there. For standard built-in sound, just refer to it. For none built-in sound, discard it.
- Office Open XML
- View source
- Recent changes
- Download AOO
- What links here
- Related changes
- Special pages
- Permanent link
- Page information
- This page was last modified on 22 June 2012, at 08:57.
- Content is available under ALv2 unless otherwise noted.
- About Apache OpenOffice Wiki
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Open a spreadsheet document from a stream
- 3 contributors
This topic shows how to use the classes in the Open XML SDK for Office to open a spreadsheet document from a stream programmatically.
When to Open From a Stream
If you have an application, such as Microsoft SharePoint Foundation 2010, that works with documents by using stream input/output, and you want to use the Open XML SDK to work with one of the documents, this is designed to be easy to do. This is especially true if the document exists and you can open it using the Open XML SDK. However, suppose that the document is an open stream at the point in your code where you must use the SDK to work with it? That is the scenario for this topic. The sample method in the sample code accepts an open stream as a parameter and then adds text to the document behind the stream using the Open XML SDK.
Getting a SpreadsheetDocument Object
In the Open XML SDK, the SpreadsheetDocument class represents an Excel document package. To open and work with an Excel document, you create an instance of the SpreadsheetDocument class from the document. After you create the instance from the document, you can then obtain access to the main workbook part that contains the worksheets. The text in the document is represented in the package as XML using SpreadsheetML markup.
To create the class instance from the document, you call one of the Open() methods. Several are provided, each with a different signature. The sample code in this topic uses the Open(String, Boolean) method with a signature that requires two parameters. The first parameter takes a full path string that represents the document that you want to open. The second parameter is either true or false and represents whether you want the file to be opened for editing. Any changes that you make to the document will not be saved if this parameter is false .
The code that calls the Open method is shown in the following example.
- Visual Basic
After you have opened the spreadsheet document package, you can add a row to a sheet in the workbook. Each workbook has a workbook part and at least one Worksheet . To access the Workbook assign a reference to the existing document body, represented by the WorkbookPart , as shown in the following code example.
The basic document structure of a SpreadsheetML document consists of the Sheets and Sheet elements, which reference the worksheets in the workbook. A separate XML file is created for each worksheet. For example, the SpreadsheetML for a workbook that has two worksheets name MySheet1 and MySheet2 is located in the Workbook.xml file and is shown in the following code example.
The worksheet XML files contain one or more block level elements such as SheetData . sheetData represents the cell table and contains one or more Row elements. A row contains one or more Cell elements. Each cell contains a CellValue element that represents the value of the cell. For example, the SpreadsheetML for the first worksheet in a workbook, that only has the value 100 in cell A1, is located in the Sheet1.xml file and is shown in the following code example.
Using the Open XML SDK, you can create document structure and content that uses strongly-typed classes that correspond to SpreadsheetML elements. You can find these classes in the DocumentFormat.OpenXML.Spreadsheet namespace. The following table lists the class names of the classes that correspond to the workbook , sheets , sheet , worksheet , and sheetData elements.
Generating the SpreadsheetML Markup to Add a Worksheet
When you have access to the body of the main document part, you add a worksheet by calling AddNewPart<T>(String, String) method to create a new WorksheetPart . The following code example adds the new WorksheetPart .
In this example, the OpenAndAddToSpreadsheetStream method can be used to open a spreadsheet document from an already open stream and append some text to it. In your program, you can use the following example to call the OpenAndAddToSpreadsheetStream method that uses a file named Sheet11.xslx.
Notice that the OpenAddAndAddToSpreadsheetStream method does not close the stream passed to it. The calling code must do that.
The following is the complete sample code in both C# and Visual Basic.
- Open XML SDK class library reference
Trio Office: DOCX & XLSX Editor
Trio office is an all-in-one office suite. it's compatible with ms office (word, excel & powerpoint), txt, google docs, sheets & slides, pdf and openoffice format for windows. edit doc, docx, xls, xlsx, ppt, pptx, pdf. trio office can open & edit many kinds of files. for more detail, please refer to the following format list: opening doc, docx documents in addition to opendocument formats (.odt, .ott, .oth, .odm, and .fodt), word writer can open the formats used by openoffice.org 1.x (.sxw, .stw, and .sxg), the following text document formats, and a variety of legacy formats not listed below: * word 2007 - 2019 (.docx) * word 6.0/95/97/2000/xp (.doc and .dot) * word 2003 xml (.xml) * word 2007 xml (.docx, .docm, .dotx, .dotm) * winword 5 (.doc) * wordperfect document (.wpd) * wps 2000/office 1.0 (.wps) * .rtf, .txt, and .csv * starwriter formats (.sdw, .sgl, .vor) * docbook (.xml) * unified office format text (.uot, .uof) * ichitaro 8/9/10/11 (.jtd and .jtt) * hangul wp 97 (.hwp) * t602 document (.602, .txt) * aportisdoc (palm) (.pdb) * pocket word (.psw) * ebook (.pdb) * apple pages 4 (.pages) * html document (.htm, .html) opening xls, xlsx spreadsheets in addition to opendocument formats (.ods, .ots, and .fods), calc can open the formats used by openoffice.org 1.x (.sxc and .stc) and the following spreadsheet formats: * excel 2007 - 2019 (.xlsx) * excel 97/2000/xp (.xls, .xlw, and .xlt) * excel 4.x - 5.0/95 (.xls, .xlw, and .xlt) * excel 2003 xml (.xml) * excel 2007 xml (.xlsx, .xlsm, .xltx, .xltm) * excel 2007 binary (.xlsb) * lotus 1-2-3 (.wk1, .wks, and .123) * data interchange format (.dif) * rich text format (.rtf) * text csv (.csv and .txt) * starcalc formats (.sdc and .vor) * dbase (.dbf) * sylk (.slk) * unified office format spreadsheet (.uos, .uof) * .htm and .html files, including web page queries * pocket excel (pxl) * quattro pro 6.0 (.wb2) * apple numbers 2 (.numbers) opening ppt, pptx presentations in addition to opendocument formats (.odp, .odg, .otp, and .fopd), impress can open the formats used by openoffice.org 1.x (.sxi and .sti) and the following presentation formats: * powerpoint 2007 - 2019 (.pptx) * powerpoint 97/2000/xp (.ppt, .pps, and .pot) * powerpoint 2007 (.pptx, .pptm, .potx, .potm) * stardraw and starimpress (.sda, .sdd, .sdp, and .vor) * unified office format presentation (.uop, .uof) * cgm - computer graphics metafile (.cgm) * apple keynote 5 (.key) opening pdf * portable document format (.pdf) opening graphic files in addition to opendocument formats (.odg and .otg), draw can open the formats used by openoffice.org 1.x (.sxd and .std) and the following graphic formats: * adobe photoshop (.psd) * autocad interchange format (.dxf) * bmp jpeg jpg * corel draw (.cdr) * corel presentation exchange (.cmx) * dxf met pgm ras svm xbm * emf pbm plt sda tga xpm * eps pcd png sdd tif * publisher 98-2010 (*.pub) * visio 2000-2013 (*.vdx; *.vsd; *.vsdm; *.vsdx) * pcx psd sgv * tiff gif pct ppm sgf vor * wordperfect graphics (*.wpg) opening formula files in addition to opendocument formula (.odf) files, math can open the format (.sxm), starmath, (.smf), and mathml (.mml) files. when opening a word document that contains an embedded equation editor object, if the option for it is checked in tools > options > load/save > office, the object will be automatically converted to a trio office math object. ***file formats trio office can save to saving doc, docx documents in addition to opendocument formats (.odt and .ott), word writer can save in these formats: * openoffice.org 1.x text document (.sxw) * openoffice.org 1.x text document template (.stw) * word 2007 - 2019 (.docx) * word 6.0, 95, and 97/2000/xp (.doc) * word 2003 xml (.xml) * rich text format (.rtf) * starwriter 3.0, 4.0, and 5.0 (.sdw) * starwriter 3.0, 4.0, and 5.0 template (.vor) * text (.txt)text encoded (.txt) * unified office format text (.uot, .uof) * html document (openoffice.org writer) (.html and .htm) * docbook (.xml) * aportisdoc (palm) (.pdb) * pocket word (.psw) saving xls, xlsx spreadsheets in addition to opendocument formats (.ods and .ots), calc can save in these formats: * openoffice.org 1.x spreadsheet (.sxc) * openoffice.org 1.x spreadsheet template (.stc) * excel 2007 - 2019 (.xlsx) * excel 97/2000/xp (.xls and .xlw) * excel 97/2000/xp template (.xlt) * excel 5.0 and 95 (.xls and .xlw) * excel 2003 xml (.xml) * data interchange format (.dif) * dbase (.dbf)sylk (.slk)text csv (.csv and .txt) * starcalc 3.0, 4.0, and 5.0 formats (.sdc and .vor) * unified office format spreadsheet (.uos) * html document (openoffice.org calc) (.html and .htm) * pocket excel (.pxl) saving ppt, pptx presentations in addition to opendocument formats (.odp, .otp, and .odg), impress can save in these formats: * openoffice.org 1.x presentation (.sxi) * openoffice.org 1.x presentation template (.sti) * powerpoint 2007 - 2019 (.pptx) * powerpoint 97/2000/xp (.ppt) * powerpoint 97/2000/xp template (.pot) * stardraw, starimpress (.sda, .sdd, and .vor) * unified office format presentation (.uop) impress can also export to macromedia flash (.swf) and any of the graphics formats listed for draw. saving drawings draw can only save in the opendocument drawing formats (.odg and .otg), the openoffice.org 1.x formats (.sxd and .std) and stardraw format (.sda, .sdd, and .vor). however, draw can also export to bmp, emf, eps, gif, jpeg, met, pbm, pct, pgm, png, ppm, ras, svg, svm, tiff, wmf, and xpm. saving pdf * portable document format (.pdf) word editor/web can save in these formats * html document (.html and .htm), as html 4.0 transitional * openoffice.org 1.0 html template (.stw) * openoffice.org 2.x html template (.oth) * starwriter/web 4.0 and 5.0 (.vor) * text (openoffice.org writer/web) (.txt) * text encoded (openoffice.org writer/web) (.txt) trio office full version: in-app purchases features • print documents • insert pictures, tables and shapes • templates • export as pdf and epub format • no advertisement • 7*24 support subscription plan: billed annually at $7.99/year lifetime license: one-time purchase for $19.99 trio office is a 3rd party software that is not associated with, endorsed by or affiliated with microsoft., 1/3/2019 2:10:15 pm.