Originally Posted by
shish
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?
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.