Over a million developers have joined DZone.

Tips For Using DSOFile On x64 OS and With OpenXML

DZone's Guide to

Tips For Using DSOFile On x64 OS and With OpenXML

· ·
Free Resource

Visual Studio Office Development (VSOD) Support Team - Considerations for using Dsofile on 64 bit OS

"There is a well-documented sample program, DSOFile, that enables reading and writing Office document properties (both old format files like *.xls, *.doc and *.ppt, as well as the new open xml formats like *.xlsx, *.docx and *.pptx). The DSOFile sample is compiled as 32 bit.

If you are using this sample in a 32 bit application on a machine with Office 2007 SP2 , Windows 64 bit, then DsoFile will not be able to fetch the properties of Open Xml format files.  This is because Office 2007 SP2 did not ship the 32 bit version of msoshext.dll (shell extension handler) which is the component DSOFile uses to read/write properties from Open XML files .

This issue is fixed in hotfix KB 2483216. This is also included in the Office 2007 Cumulative Update for February 2011 and subsequently in Office 2007 SP3.

The Office 2010 version of he hotfix is KB 2483230. This is also included in Office 2010 Cumulative Update for February 2011 and subsequently in Office 2010 SP1

If you wish to use DSOFile from a 64 bit program, then you should recompile the DSOFile to target for 64 bit.

An alternative approach to using Dsofile would be to use Open Xml SDK (or System.IO.Packaging). A sample that demonstrates this is given below :-..."

Can you believe I've been using DSOFile for over  8+ years? I first blogged about it in 2004... I find it interesting that it's still around and kind of, sort of, mostly supported. One thing I didn't know what was it supported (kind of, sort of) Open XML doc formats (if Office 2007/2010 is installed or the given msoshext.dll was available, which kind of defeats the purpose of a "no Office needed COM component to access Doc Properties, but still...).

In any case, if you need access to the COM Doc/Summary Properties from Office binary doc's and/or the Open XML doc's, this COM component has been pretty rock solid for me for many years...

What is DSO file again? The Dsofile.dll files lets you edit Office document properties when you do not have Office installed

The Dsofile.dll sample file is an in-process ActiveX component for programmers that use Microsoft Visual Basic .NET or the Microsoft .NET Framework. You can use this in your custom applications to read and to edit the OLE document properties that are associated with Microsoft Office files, such as the following:

  • Microsoft Excel workbooks
  • Microsoft PowerPoint presentations
  • Microsoft Word documents
  • Microsoft Project projects
  • Microsoft Visio drawings
  • Other files that are saved in the OLE Structured Storage format

The Dsofile.dll sample file is written in Microsoft Visual C++. The Dsofile.dll sample file demonstrates how to use the OLE32 IPropertyStorage interface to access the extended properties of OLE structured storage files. The component converts the data to Automation friendly data types for easier use by high level programming languages such as Visual Basic 6.0, Visual Basic .NET, and C#. The Dsofile.dll sample file is given with full source code and includes sample clients written in Visual Basic 6.0 and Visual Basic .NET 2003 (7.1).


Information about OLE document properties
Every OLE compound document can store additional information about the document in persistent property sets. These are collectively called the "Document Summary Properties." These property sets are managed by "COM/OLE" so that third-party clients can read this information without the aid of the main application that is responsible for the file. 
To help developers that are interested in reading document properties, we have provided the following two interfaces to manage property sets:
  • IPropertySetStorage
  • IPropertyStorage
However, some high-level programming languages may have trouble using these interfaces because the interfaces are not Automation-compatible. To resolve this problem, developers can use an ActiveX DLL, such the "DsoFile sample" to read and to write the most common properties that are used in OLE compound documents. This applies particularly those that are used by Microsoft Office applications.
Use the DsoFile component from your custom application
The Dsofile.dll sample file reads and writes to both the standard properties and the custom properties from any "OLE Structured Storage" file. This includes, but is not limited to, the following:
  • Word documents
  • Excel workbooks
  • PowerPoint presentations

Because of the size and the speed of the Dsofile.dll sample file, the DLL can be much more efficient than trying to Automate Office to read document properties


Related Past Post XRef: 
Download details: Developer Support OLE File Property Sample (DSOFILE) (DSOFile.DLL 2.0)  
DSOFile.dll 2.0

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}