You need to sign in to do that
Don't have an account?
![Tre Pedigo Tre Pedigo](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Help with visualforce word document rendering
Hello all,
I have rendered my visualforce page as a microsoft word document, so that upon going to it you are prompted to download the word file. The problem is that I have inserted this page into the "Opportunity" page layout, and now every time I go to a specific opportunity it prompts me to download the word document. Our sales team obviously doens't want to have to deal with this everytime they want to view an opportunity. Is there any way to edit my vf page so that it gives an option of downloading the displayed information as a word document, instead of what I have described above? My code is as follows:
<apex:page standardController="Opportunity" contentType="application/msword">
<head>
</head>
<body>
<center>
<h1>Opportunity </h1>
<apex:panelGrid columns="2" width="70%">
<b> Opportunity Name: </b><apex:outputText value="{!Opportunity.name}" styleClass="companyName"/>
<b>Sales Engineer: </b><apex:outputText value="{!Opportunity.Sales_Engineer__r.FirstName&" "& Opportunity.Sales_Engineer__r.LastName}" styleClass="companyName"/>
<b>Sales Person: </b><apex:outputText value="" />
<b>Related Account Name: </b><apex:outputText value="{!Opportunity.Account.name}" styleClass="companyName"/>
<b>Building Square Footage: </b><apex:outputText value="{!Opportunity.Building_Square_Footage__c}" styleClass="companyName"/>
<b>Subscription Term (months): </b><apex:outputText value="{!Opportunity.Subscription_Term_Months__c}" styleClass="companyName"/>
<b>Total contract value: </b><apex:outputText value="{0,number,currency}" styleClass="companyName">
<apex:param value="{!Opportunity.TCV__c}" />
</apex:outputText>
<b>Existing or New Construction? </b><apex:outputText value="{!Opportunity.Pipeline_Type__c}" styleClass="companyName"/>
<b>Impelementation Manager: </b><apex:outputText value="" styleClass="companyName"/>
<b>Customer Success Manager: </b><apex:outputText value="" styleClass="companyName"/>
<b>Impelementation Engineer: </b><apex:outputText value="" styleClass="companyName"/>
<b>Customer Success Associate: </b><apex:outputText value="" styleClass="companyName"/>
<b>Impelementation Engineer: </b><apex:outputText value="" styleClass="companyName"/>
<b>Impelementation Engineer: </b><apex:outputText value="" styleClass="companyName"/>
<apex:outputText value="{!NOW()}"></apex:outputText>
</apex:panelGrid>
</center>
</body>
</apex:page>
Any help would be greatly appreciated!
I have rendered my visualforce page as a microsoft word document, so that upon going to it you are prompted to download the word file. The problem is that I have inserted this page into the "Opportunity" page layout, and now every time I go to a specific opportunity it prompts me to download the word document. Our sales team obviously doens't want to have to deal with this everytime they want to view an opportunity. Is there any way to edit my vf page so that it gives an option of downloading the displayed information as a word document, instead of what I have described above? My code is as follows:
<apex:page standardController="Opportunity" contentType="application/msword">
<head>
</head>
<body>
<center>
<h1>Opportunity </h1>
<apex:panelGrid columns="2" width="70%">
<b> Opportunity Name: </b><apex:outputText value="{!Opportunity.name}" styleClass="companyName"/>
<b>Sales Engineer: </b><apex:outputText value="{!Opportunity.Sales_Engineer__r.FirstName&" "& Opportunity.Sales_Engineer__r.LastName}" styleClass="companyName"/>
<b>Sales Person: </b><apex:outputText value="" />
<b>Related Account Name: </b><apex:outputText value="{!Opportunity.Account.name}" styleClass="companyName"/>
<b>Building Square Footage: </b><apex:outputText value="{!Opportunity.Building_Square_Footage__c}" styleClass="companyName"/>
<b>Subscription Term (months): </b><apex:outputText value="{!Opportunity.Subscription_Term_Months__c}" styleClass="companyName"/>
<b>Total contract value: </b><apex:outputText value="{0,number,currency}" styleClass="companyName">
<apex:param value="{!Opportunity.TCV__c}" />
</apex:outputText>
<b>Existing or New Construction? </b><apex:outputText value="{!Opportunity.Pipeline_Type__c}" styleClass="companyName"/>
<b>Impelementation Manager: </b><apex:outputText value="" styleClass="companyName"/>
<b>Customer Success Manager: </b><apex:outputText value="" styleClass="companyName"/>
<b>Impelementation Engineer: </b><apex:outputText value="" styleClass="companyName"/>
<b>Customer Success Associate: </b><apex:outputText value="" styleClass="companyName"/>
<b>Impelementation Engineer: </b><apex:outputText value="" styleClass="companyName"/>
<b>Impelementation Engineer: </b><apex:outputText value="" styleClass="companyName"/>
<apex:outputText value="{!NOW()}"></apex:outputText>
</apex:panelGrid>
</center>
</body>
</apex:page>
Any help would be greatly appreciated!
All Answers
The button was a great idea. Thank you. However, the opportunity page is still automatically downloading the word document.