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
GABRIELLA FARIAS MENDESGABRIELLA FARIAS MENDES 

Format Visual Force which generate a .doc document.

Good afternoon. I have this Visual Force which generate a .doc document. This document is not aligned properly.
How can I create a TAG or a parameter to format all the document as "center" or "justify".

<apex:page StandardController="PropostaCredito__c" extensions="CPRController" cache="true" contentType="application/msWord#msword.doc"> <!--<apex:page StandardController="PropostaCredito__c" extensions="CPRController" cache="true">--> <html xmlns:w="urn:schemas-microsoft-com:office:word"> <body> <apex:outputText value="{!documento}" escape="false"></apex:outputText> </body> </html> </apex:page>
NahuelNahuel
This helped me a lot when doing Visualforce as PDF, check it out:
http://www.antennahouse.com/CSSInfo/CSS-Page-Tutorial-en.pdf
Naval Sharma4Naval Sharma4
Hi,

Setting the content type to msword.doc will generate the document but it will not be able to maintain the CSS and alignments. You will have to use other 3rd party apps which generate docs based on salesforce data. I have some examples like conga composer, Dynamo.

Thanks