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
Matt WhalleyMatt Whalley 

Visualforce to Word - Headers and footers taking up space in the body

I have a multi-section, multi-page word doc that has different headers and footers throughout.  While I can get all that to work, the headers and footers take up space in the body since they print normally - so I set a margin of 10 inches to the side to hide it.  Problem is, it looks like there are blank pages if the hieght of the header and footer is not available in the last page of the section.

So I guess one solution would be is how to not have the headers and footers show up if I don't set the margin to 10 inches to the right.  Here is a code example of a header:

<div style="mso-element:header;margin:0in 0in 0in 10in;" id="h2">
      Some Header Text
</div>

I can get it to work in PDF, but that is not an option.
Matt WhalleyMatt Whalley
If anyone is following this, Salesforce came back saying this is a problem with going from HTML to Word, and there is really nothing you can do about it.  Not even fun VML hacks will work.  So if anyone is complaining about this, you are simply out of luck.