View Single Post
  #8 (permalink)  
Old 01-07-2008, 05:17 AM
roots's Avatar
roots roots is offline
Moderator
 
Join Date: Jan 2008
Location: Dallas
Posts: 263
roots is on a distinguished road
Quote:
Originally Posted by shish View Post
Hi there

Is possible to retreive the Author name from any file (.doc/.ppt/.xls etc.)?
Is there any java code that can help me to get author of a file?

Please help me?
Code:
POIDocument document = new HWPFDocument(new FileInputStream("a.doc")); System.out.println(document.getSummaryInformation().getAuthor()); POIDocument workbook = new HSSFWorkbook(new FileInputStream("a.xls")); System.out.println(workbook.getSummaryInformation().getAuthor()); POIDocument show = new HSLFSlideShow(new FileInputStream("a.ppt")); System.out.println(show.getSummaryInformation().getAuthor());
HPSF HOW-TO

It works - please Download Apache POI and put in class path before executing above code.
__________________
dont worry newbie, we got you covered.
Reply With Quote