我想阅读.word格式文档正文和以字符串形式显示VF页面中的正文内容

时间:2014-05-31 15:01:07

标签: salesforce apex

我在Document Object中上传了一个.word文件。现在我想获取该文件的内容(正文),我想在Visual Force Page中显示整个内容。

Document doc = [Select d.body from Document d where d.name='docname';
Blob b = doc.body;
String Str = b.toString();

//This Giving an Error Encoding UTC8.

//Then Modified to like below but it's not giving correct data.
//It's giving like    @5ywnnn7*96w**.

Document doc = [Select d.body from Document d where d.name='docname';
Blob b = doc.body;
String Str = EncodingUtil.base64Encode(b);

提前致谢。

0 个答案:

没有答案