Put footer only from the second page of vfs

csshtmlms-wordvisualforce

I'm generating a vfp as word via contentType="application/msword but I want the footer tag to appear only from the second page of the document, does anyone know how I can do this? it can be a code for me to base myself on, a post, an article lol
Already thanks for listening
I saw some answers here about this problem but I still don't understand how it should look in the code.

<head>
        <style type="text/css" media="print">
              @page Section1 {
                  size:8.3in 11.7in;
                  mso-footer:f1;
                  mso-header:h1;
                  margin:0.0in 0.6in 0.0in 0.6in;
                  mso-header-margin:0.0in;
                  mso-footer-margin:0.0in;
              }
            
              div.Section1{ 
                page:Section1;
              }
              
              p.MsoFooter, li.MsoFooter, div.MsoFooter { 
              
                  mso-pagination:widow-orphan;
              }

<body>
        <!-- Content -->
        <div class="Section1">
            <!-- Cover Page 1  -->
            <div class="coverP">
            Cover page text goes here
            </div>

            <br clear="all" style="page-break-before:always" />

            <!-- Page 2 Starts -->
           <div>
           Page 2 goes here with footer (pg#2 and logo)
           </div>

           <br clear="all" style="page-break-before:always" />
           <!-- Page 3 Starts -->
        <div>
           page 3 go here with footer (pg#2 and logo)
         </div>  
<!---------- HEADER AND FOOTER SECTIONS --------------->
      
      <br clear="all" style="page-break-before:always" />
      <div style="mso-element:header" id="h1">
      <table>...</table> 
      </div> 

   <div style="mso-element:footer" id="f1" >
   <table>...</table>  
</div>
</body>
</html>

told to configure mso-title-page: yes; but where? And they also said to replace mso- with mso-first- but again where and how? if anyone knows how to give me a light, I would appreciate it, or even send me the link to the documentation…
Follow the link of someone else with the same problem:

https://stackoverflow.com/questions/22879941/apply-different-first-page-ms-word-option-for-header-and-footer-to-dynamically

Best Answer

Good people, I got it. I will share the solution that worked for me. I'm developing using a visualforce page but the code can be adapted to html or etc. Set mso-title-page:yes; The leap of the cat is to define in @page 2 footers one for the first page and another for the other pages, the same goes for the header, then just create the elements (footer and header) with IDs referring to the footer/heade of the first page or the others, in my case as I wanted the first page to have a header but not a footer, I didn't create a footer for the first page. It gets clearer in the code.

<head>
        <style type="text/css" media="print">
              @page Section1 {
                  size:8.3in 11.7in;
                  mso-title-page:yes;<!--Aqui dizemos que esse documento vai possuir uma página título--->
                  mso-footer:f1;<!--Definimos o ID para o footer de todas as páginas, execeto a primeira-->
                  mso-header:h1;<!--Definimos o ID para o header de todas as páginas, execeto a primeira-->
                  mso-first-header: fh1;<!--Definimos o ID para o header da primeira página-->
                  mso-first-footer: ff1;<!--Definimos o ID para o footer da primeira página-->
                  margin:0.0in 0.6in 0.0in 0.6in;
                  mso-header-margin:0.0in;
                  mso-footer-margin:0.0in;
              }
            
              div.Section1{ 
                page:Section1;
              }

.
.
.
Códigos
.
.
.
   <!---------- HEADER AND FOOTER SECTIONS --------------->
      
    <br clear="all" style="page-break-before:always" />
      <div style="mso-element:header" id="h1">
      <!--  Código para a construção do header padrão -->
      </div>

   <br clear="all" style="page-break-before:always" />
      <div style="mso-element:footer" id="f1">
      <!--  Código para a construção do footer padrão -->
      </div>

   <br clear="all" style="page-break-before:always" />
      <div style="mso-element:header" id="fh1">
      <!--  Código para a construção do header exclusivo para a 1° página -->
      </div>


<!--Como eu não queria footer na primeira página, foi só não construir um footer que apontasse para o: style="mso-element:footer" id="ff1" -->

Now it seems simple but it gave me a headache, I hope to help those who face the same problem, remembering that the explanation I did based on what I understood, so if you have more knowledge and want to contribute, I'll be happy to hear and make changes.

Useful links https://www.py4u.net/discuss/987057 http://techsynapse.blogspot.com/2007/03/generating-word-document-dynamically.html http://www.pbdr.com/ostips/wordfoot.htm https://theviewfromouthere.wordpress.com/2009/10/08/turning-a-visualforce-page-into-a-word-document/ https://sebsauvage.net/wiki/doku.php?id=word_document_generation