+ Start a Discussion
ckumckum 

Unable to get Footer in Word Doc

Hi,

 

I have created a Word Doc using contentType="application/msWord" . I want to add Footer in my Word Doc. How can I do that.  I have used many ways but unable to get the footer. I found Header by using thead Tag in my page, but unable to get Footer after using tfoot tag.

 

Please help......

 

Regards,

ckum

 

stephanstephan

Note that when specifying a content type like this, we're not actually creating a word doc on the server. We're simply sending HTML with a content type that causes the browser to pass it on to Word. Word itself then takes the HTML content and  converts it to doc format. What you'll need to do, then, is know how to format your HTML in a way that word can understand, as far as generating a footer. I'd start by checking their reference:

 

http://msdn.microsoft.com/en-us/library/aa155477%28office.10%29.aspx

 

...stephan

ckumckum

Hey Stephan, thanks for the response. I am still unable to get the footer. I tried everything as per my knowledge, but no success. Please help!!!!!!!!!

 

 

Regards,

ckum

stephanstephan

This may provide more guidance:

 

http://www.pbdr.com/ostips/wordfoot.htm

ckumckum

Hey Stephan,

 

Thanks for the link. I found the footer, but I am again facing 2 problems in it. It is showing footer twice in the last page. In other pages it is coming only one time. Secondly, unable to get the page number in the Footer.

 

My code is as below:

<apex:page standardController="opportunity" extensions="BES_Quote_DOC" contentType="application/msWord" cache="true" standardStylesheets="false"> <head> <style> @page {mso-footer:f1;} div.Section1{page:Section1;} p.MsoFooter, li.MsoFooter, div.MsoFooter{ mso-pagination:widow-orphan; tab-stops:center 216.0pt right 432.0pt;} </style> </head> <body> <div class="Section1"> <table border='0' align="center" width="100%"> <apex:form id="hidDiv"> <div id="Test Logo"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <apex:outputLabel value="Date: {!dtToday} " style="font-size:80%; font:Arial, Helvetica, sans-serif;"/> </td> </tr> <tr> <td> &nbsp; </td> </tr> <tr> <td> <apex:outputLabel value="{!oppCustomer}" style="font-size:80%; font:Arial, Helvetica, sans-serif;"/> </td> </tr> <tr> <td> <apex:outputLabel value="{!oppBillingStreet}" style="font-size:80%; font:Arial, Helvetica, sans-serif;"/> </td> </tr> <tr> <td> <apex:outputLabel value="{!oppBillingCity}" style="font-size:80%; font:Arial, Helvetica, sans-serif;"/> </td> </tr> <tr> <td width='90px'> <apex:outputLabel value="{!oppBillingState} , {!oppBillingZip}" style="font-size:80%; font:Arial, Helvetica, sans-serif;"/> </td> </tr> <tr> <td> &nbsp; </td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5%"> <b><apex:outputLabel value="Attention:&nbsp;&nbsp;" style="font-size:80%; font:Arial, Helvetica, sans-serif;"/></b> </td> <td> <apex:outputLabel value="{!oppPriContName}" style="font-size:80%; font:Arial, Helvetica, sans-serif;"/> </td> </tr> <tr> <td width="5%"> <b><apex:outputLabel value="" style="font-size:80%; font:Arial, Helvetica, sans-serif;"/></b> </td> <td style="font-size:80%; font:Arial, Helvetica, sans-serif;"> <b>T:</b><apex:outputLabel value=" {!oppPriContPhone}" /> </td> </tr> <tr> <td width="5%"> <b><apex:outputLabel value="" style="font-size:80%; font:Arial, Helvetica, sans-serif;"/></b> </td> <td style="font-size:80%; font:Arial, Helvetica, sans-serif;"> <b>F:</b><apex:outputLabel value=" {!oppPriContFax}" /> </td> </tr> <tr> <td width="5%"> <b><apex:outputLabel value="" style="font-size:80%; font:Arial, Helvetica, sans-serif;"/></b> </td> <td style="font-size:80%; font:Arial, Helvetica, sans-serif;"> <b>e-mail:</b><apex:outputLabel value=" {!oppPriContEmail}" /> </td> </tr> </table> <br/> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5%"> <b><apex:outputLabel value="Reference:&nbsp;&nbsp;" style="font-size:80%; font:Arial, Helvetica, sans-serif;"/></b> </td> <td> <apex:outputLabel value="{!oppNumber}{!oppRevNumber}" style="font-size:80%; font:Arial, Helvetica, sans-serif;"/> </td> </tr> <tr> <td> &nbsp; </td> </tr> <tr> <td colspan='2'> <apex:outputLabel value="Test {!oppTestLocation} is pleased to submit the following quotation:" style="font-size:80%; font:Arial, Helvetica, sans-serif;"/> </td> </tr> </table> <apex:pageBlock > <br/> <table border='1' width="100%" class="list" cellpadding="0" cellspacing="0"> <tbody border='1' style="background-color: #FFFFAA;"> <tr class="headerRow"> <th width="5%" scope="col" class="" style="font-size:80%; font:Arial, Helvetica, sans-serif;"> Item </th> <th width="20%" scope="col" class="" style="font-size:80%; font:Arial, Helvetica, sans-serif;"> Part Number </th> <th width="30%" scope="col" class="" style="font-size:80%; font:Arial, Helvetica, sans-serif;"> Description </th> <th width="15%" scope="col" class="" style="font-size:80%; font:Arial, Helvetica, sans-serif;" align='center'> Quantity </th> <th width="15%" scope="col" class="" style="font-size:80%; font:Arial, Helvetica, sans-serif;" align='center'> Unit Price </th> <th width="15%" scope="col" class="" style="font-size:80%; font:Arial, Helvetica, sans-serif;" align='center'> Delivery (Weeks ARO) </th> </tr> </tbody> </table> <table width="100%" border='1' cellpadding="0" cellspacing="0"> <apex:repeat value="{!OppProducts}" var="op"> <tr> <td width="5%" valign="top" align='center'> <apex:outputLabel style="font-size:80%; font:Arial, Helvetica, sans-serif;" id="temp1" value="{!op.Counter}" /> </td> <td width="20%" valign="top" align='center'> <span style="padding: 2px 0px 2px 7px;text-align:left"> <apex:outputLabel style="font-size:80%; font:Arial, Helvetica, sans-serif;" id="temp2" value="{!op.productName}" /> </span> </td> <td width="30%" valign="top"> <apex:outputLabel style="font-size:80%; font:Arial, Helvetica, sans-serif;" id="temp3" value="{!op.description}" /> </td> <td width="45%" valign="top" > <apex:outputPanel id="opQR"> <table border='1' width="100%" cellpadding="0" cellspacing="0"> <apex:repeat value="{!op.LSTQR}" var="QR"> <tr > <td width="33%" align='right' > <apex:outputLabel style="font-size:80%; font:Arial, Helvetica, sans-serif;" value="{!QR.quantity} " id="txtQuantity" />&nbsp;&nbsp; </td> <td width="33.5%" align='right' > <apex:outputLabel style="font-size:80%; font:Arial, Helvetica, sans-serif;" value="{!QR.unitprice} " id="lblUnitPrice" />&nbsp;&nbsp; </td> <td width="33.5%" align='right'> <apex:outputLabel style="font-size:80%; font:Arial, Helvetica, sans-serif;" value="{!QR.ARO} " id="lblARO" />&nbsp;&nbsp; </td> </tr> </apex:repeat> </table> </apex:outputPanel> </td> </tr> </apex:repeat> </table> </apex:pageBlock> <br></br> <table border='1' width="100%" cellpadding="0" cellspacing="0"> <tr> <td style="font-size:80%; font:Arial, Helvetica, sans-serif;"> <b> Note: </b><apex:outputLabel value=" {!oppNote} " id="lblARO" />&nbsp;&nbsp; </td> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td width="5%"> <b><apex:outputLabel value="Terms:" style="font-size:80%; font:Arial, Helvetica, sans-serif;" /></b> </td> <td> <apex:outputLink value="www.test.com/PLNTerms&Conditions" id="theLink" style="font-size:80%; font:Arial, Helvetica, sans-serif;">www.test.com/PLNTerms&Conditions</apex:outputLink> </td> </tr> <tr><td>&nbsp;</td></tr> <tr> <td colspan='2'> <apex:outputLabel style="font-size:80%; font:Arial, Helvetica, sans-serif;" value="This condition is valid until {!QValidDate}." style="font-size:80%; font:Arial, Helvetica, sans-serif;" /> </td> </tr> <tr><td>&nbsp;</td></tr> <tr> <td colspan='2' style="font-size:80%; font:Arial, Helvetica, sans-serif;" > <p> <b> Test Plainview reserves the right to provide an updated quotation after reviewing any items that are currently undefined or to be determined.</b> </p> </td> </tr> <tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr> <tr> <td colspan='2' style="font-size:80%; font:Arial, Helvetica, sans-serif;"> <p> Once again thank you for the opportunity to fulfill your requirements on this important program. If you have any questions, please do not hesitate to contact the undersigned at {!oppOwnerPhone} or via e-mail at {!oppOwnerEmail}. </p> </td> </tr> </table> <br/> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td> <apex:outputLabel value="Regards," style="font-size:80%; font:Arial, Helvetica, sans-serif;" /> </td> </tr> <tr> <td> <apex:outputLabel value="{!oppOwnerName}" style="font-size:80%; font:Arial, Helvetica, sans-serif;" /> </td> </tr> <tr> <td> <apex:outputLabel value="Regional Sales Manager" style="font-size:80%; font:Arial, Helvetica, sans-serif;" /> </td> </tr> <tr><td>&nbsp;</td></tr> <tr> <td width='500px'> <apex:outputLabel value="cc: {!oppRep}" style="font-size:80%; font:Arial, Helvetica, sans-serif;" /> </td> </tr> <tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr> <tr> <td> <b><apex:outputLabel value="Notes & Stipulation:" style="font-size:80%; font:Arial, Helvetica, sans-serif;" /></b> </td> </tr> </table> <br/> <table width="100%" class="list" cellpadding="0" cellspacing="0"> <apex:repeat value="{!QuoteNotes}" var="QN"> <tr> <td width="5%" align='center' valign="top"> <apex:outputLabel style="font-size:80%; font:Arial, Helvetica, sans-serif;" value="{!QN.NoteOrder}" /> </td> <td width="95%"> <apex:outputLabel style="font-size:80%; font:Arial, Helvetica, sans-serif;" value="{!QN.Description}" /> </td> </tr> </apex:repeat> </table> </div> </apex:form> <div style="mso-element:footer" id="f1"> <table id='tbFoot' width="100%" border="0" cellspacing="0" cellpadding="0" > <tr> <td> <p class='MsoFooter' align="left" style="font-size: 10px">Test {!oppTestLocation}, Inc. <b>.</b> 35 South Service Road <b>.</b> Plainview, New York 11803 Phone: 516-694-6700 <b>.</b> Fax: 516-694-6715 <b>.</b> www.test.com</p> </td> <td> <p class='MsoFooter' align="right" style="font-size: 10px">PAGENUMBER ?</p> </td> </tr> </table> </div> </div> </body> </apex:page>

 

Please tell how can I get only one footer in every page of the Doc and the Page number in the Footer?

 

 

Thanks

ckum 

 

 

IsaygarciaIsaygarcia

You still need the html tag to get it working.

 

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word>

<!-- Your Content -->


</html>