[]
Gets or sets whether the header and footer are aligned with the margins set in the page setup options.
Use this property to determine whether header and footer content follows the left and right page margins when the worksheet is printed or exported as pages.
public bool AlignMarginsHeaderFooter { get; set; }
Public Property AlignMarginsHeaderFooter As Boolean
PageSettings pageSettings = new PageSettings();
pageSettings.AlignMarginsHeaderFooter = true;
bool alignMargins = pageSettings.AlignMarginsHeaderFooter;