Can you render a visualforce page as a word document?? - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Daniel TantumDaniel Tantum 

Can you render a visualforce page as a word document??

I currently render a visual force page as a pdf using the following;

<apex:page standardController="Non_Stores_Offers__c" showHeader="false" renderAs="pdf" >

Can you render it as a word document?

I've tried the obvious changing pdf to docx and doc but it doesn't work.I currently render a visual force page as a pdf using the following;
Karanraj SankaranarayananKaranraj Sankaranarayanan
use <apex: page contentType="application/msWord">

If need any help regrading apex and visualforce page kindly use developer board
http://boards.developerforce.com/sforce/?category.id=developers
Ankit ShuklaAnkit Shukla
Hello,
For your issue solution is

Remove "renderAs" attribute
  • Add a new attribute to the page tag: "ContentType":
    - For Word: contentType="application/msword"
Thanks!!
Daniel TantumDaniel Tantum
Thank you, much appreicated.

Karanraj SankaranarayananKaranraj Sankaranarayanan
if my suggestion(s) worked,  let us know by marking the answer as "Best Answer" right under the comment. This will help the rest of the community should they have a similar issue in the future.  Thanks so much!