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

Running Header and Footer is repeating while rendering as a word

Hi All ,
While  redering  Quote as word file ,I am facing a problem like ,Header is repeting twice in first page and footer  is repeating twice in last page .
Can nay one suggest me how to solve this issue .
Below is my code snipnet .

<apex:page sidebar="false" showChat="false" showHeader="false" contentType="application/msword#Test.doc" cache="true"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <style> @page Main { mso-header:h1; mso-footer:f1; } div.Main{ page:Main; } p.MyFoot, li.MyFoot, div.MyFoot{ mso-pagination:widow-orphan; tab-stops:center 216.0pt right 432.0pt; } p.MyHead { } </style> </head> <body> <div class="Main"> <div style="mso-element:header" id="h1"> <img src="" style="height:10px;width:10px"/> </div> <div>Ashutosh Kumar Srivastava</div> <br style="page-break-after: always;"/> <div style="mso-element:footer" id="f1"> <img src="" style="height:10px;width:10px"/> </div> </div> </body> </html> </apex:page>

Any help is heartily appreciated .
have you tried rendering as html? to see if this is an artifact of the way word parses the html? (naming the contentType="application/msWord" doesn't mean it writes a .docx file, only that it writes html and opens it with word. 
krishna chaitanya 35krishna chaitanya 35
Hi @Manojjena ,i am also facing the issue,i am converting case details to word document and footer is displayed normally and repeated once in last page.If you have any solution can you please update me.