poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chandrasekhar M" <Chandrasekha...@isofthealth.com>
Subject Newbie Problem - OLE2 to DOC conversion
Date Sun, 15 Mar 2009 09:49:29 GMT


I am trying to read an OLE2 document (Word Document) from a database
column (persisted as a BLOB). For simplicity, I have created a dump of
the BLOB on the file system(temp.bin)


The following is my code.


import java.io.FileInputStream;

import java.io.FileOutputStream;

import org.apache.poi.hwpf.HWPFDocument;

import org.apache.poi.poifs.filesystem.DirectoryNode;

import org.apache.poi.poifs.filesystem.POIFSFileSystem;

public class POICleanWriter {

    public static void main(String[] args) {  

            try {

                POIFSFileSystem fs =
HWPFDocument.verifyAndBuildPOIFS(new FileInputStream("E:\\temp.bin"));

                DirectoryNode dn = fs.getRoot();

                DirectoryNode docNode =
(DirectoryNode)dn.getEntry("Tenant Object");             

                HWPFDocument doc = new HWPFDocument(docNode,fs);

                doc.write(new FileOutputStream("temp.doc"));

            } catch (Exception exc) {






But when I open the resultant document, temp.doc, I am not getting the


I have tried with both poi-3.2-FINAL and poi-3.5-beta5


Looks like I am missing something here.


Attached is the zipped file, with has the OLE2 data that I am trying to


Any help is greatly appreciated.



Chandra Sekhar M.

This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
View raw message