You need to sign in to do that
Don't have an account?
Display the content of the word document in a visual force Page
I need to display only the content of the word document in a visual force Page and document will be in the contact record.
i have the Custom Attachment button in contact details page , when i click the that button the coresponding attachment content will show the Visual force page , I can retrieve the attachment via query and converted to string , but i cant assign body of the content in to visual force page,
any one help me for this???
can u refer any examples ?
Code:
public class AttachmentDownloadExtension
{
public AttachmentDownloadExtension(ApexPages.StandardController controller) {
}
private Blob fileBody{get; set;}
public String str{get; set;}
private final Contact contact;
public String getstr()
{
return this.str;
}
public Blob getFileBody()
{
return this.fileBody;
}
public void setFileBody(Blob fileBody)
{
this.fileBody = fileBody;
}
private ID contactid = ApexPages.currentPage().getParameters().get('id');
public string AttachmentDownloadExtension(ApexPages.StandardController controller)
{
Attachment[] attach = [Select body, bodyLength, ContentType, ParentId from Attachment where ParentId =: contactid ];
Blob b = attach[0].body;
str = b.toString();
return str;
}
}
As of now there is no way to inspect the contents of a word doc and place that directly into the page. You can try some the of the suggestions here:
http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=1522&query.id=37414#M1522
Thanks ya
I tried your suggestions link , it was very useful for me , but it cant be complete my requirement
I am searching.......... if u know anything more about ' Display attachment in visual force page ' send it me.