function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
surya prasad G Asurya prasad G A 

Attachment preview for word and excel files instead of downloading

Hi,

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 >



http://salesforce-walker.blogspot.com/2014/05/showing-attachment-preview-and-related.html