You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2012/02/29 08:55:06 UTC

DO NOT REPLY [Bug 51780] [PATCH] Feature Request: How to convert a dotx file to docx via poi?

https://issues.apache.org/bugzilla/show_bug.cgi?id=51780

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2012-02-29 07:55:06 UTC ---
Replacement of content types supported in r1294998. 

There is a new method  OPCPackage.replaceContentType(String oldType, String
newType) that does the job. 

Usage:

OPCPackage pkg = OPCPackage.open(new FileInputStream("macro-workbook.xlsm"));
pkg.replaceContentType(
  "application/vnd.ms-excel.sheet.macroEnabled.main+xml",
 
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml");


  FileOutputStream out = new FileOutputStream("workbook.xlsx");
  pkg.save(out);
  out.close();

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org