poi-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NSK <coolsatishku...@yahoo.com>
Subject HPSF Template POI
Date Mon, 25 Feb 2008 14:14:10 GMT
Hi,
   
  I was trying to change the template of a word document, and was not able to do so. What
format of the file path is the setTemplate() function of SummaryInformation expecting ?
   
  I tried to use the removeTemplate() function as well, and it doesn't work either.
   
  I am using POI 3.0.1.
   
  My function goes something like this
   
  ----------------------------------------
   
  try
  {
  DocumentEntry siEntry = (DocumentEntry)
  dir.getEntry(SummaryInformation.DEFAULT_STREAM_NAME);
  DocumentInputStream dis = new DocumentInputStream(siEntry);
  PropertySet ps = new PropertySet(dis);
  dis.close();
  
  si = new SummaryInformation(ps);
  }
  catch (FileNotFoundException ex)
  {
  /* There is no summary information yet. We have to create a new
  * one. */
  si = PropertySetFactory.newSummaryInformation();
  
  }
  
   
  
  if (p_template != null && p_template.length() > 0) {
  si.removeTemplate();
  si.setTemplate("c:\temp\icaseworkmacro.dot");
   
  si.write(dir, SummaryInformation.DEFAULT_STREAM_NAME);
   
  -----------------------------------
   
   
  Am I missing something ?
   
  Please help !!!
   
  Satish
   

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message