+ Start a Discussion
surya prasad G Asurya prasad G A 

Attachment preview for word and excel files instead of downloading


I have an urgent requirement that attachment view is downloading word and excel files instead of preview. I need only preview when clicking on a view button in visualforce page.
Raj VakatiRaj Vakati
Please refer this link 

You need to use Object HTML Tag
<object data="/servlet/servlet.FileDownload?file={!value}" type="application/pdf" width="{!width}" height="{!height}">
 <embed src="/servlet/servlet.FileDownload?file={!value}" width="{!width}" height="{!height}"/>
</object >