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
AhmedPotAhmedPot 

Want to display page in excel format similar to PDF

I have used below given code

<apex:page contentType="application/msWord">
  <!-- Begin Default Content REMOVE THIS -->
  <h1>Congratulations</h1>
  This is your new Page
  <!-- End Default Content REMOVE THIS -->
</apex:page>

 

When I view the page, open/save dialog box open to view the excel. I want to display the doc in browser itself like PDF files are displayed.

 

Any idea how to prevent this open/save dialog box and diaply excel inside the browser?

sfdcfoxsfdcfox

You have to use the "embed" or "object" tags in order to have it display in the browser inside a page. To make the page open as a full-browser-window "page", like PDF does, requires changing the brower's settings and the application's ability to be embedded, and is NOT affected by your Visualforce code. This can not be solved by coding Visualforce, and has to be answered at the application/operating system level.