Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ExcelSheetPageSetupFluent

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Modifiers
static

The fluent methods of ExcelSheetPageSetup, generated from its public properties: A property-named method sets a property and a singular-named method adds to a collection, both returning the same instance.

Inheritance

  • object
  • ExcelSheetPageSetupFluent

Methods

public static ExcelSheetPageSetup AlignHeaderFooterWithMargins(ExcelSheetPageSetup excelSheetPageSetup, bool value = true) #

Sets ExcelSheetPageSetup.AlignHeaderFooterWithMargins: Whether headers and footers align with the page margins.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property                                // C# fluent
excelSheetPageSetup.AlignHeaderFooterWithMargins = value;    excelSheetPageSetup.AlignHeaderFooterWithMargins(value);
public static ExcelSheetPageSetup DifferentFirstPage(ExcelSheetPageSetup excelSheetPageSetup, bool value = true) #

Sets ExcelSheetPageSetup.DifferentFirstPage: Whether the first page uses its own header and footer. Turning it on copies the running header and footer into a missing first-page variant; existing first-page text is kept when it is turned off.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property                      // C# fluent
excelSheetPageSetup.DifferentFirstPage = value;    excelSheetPageSetup.DifferentFirstPage(value);
public static ExcelSheetPageSetup DifferentOddEven(ExcelSheetPageSetup excelSheetPageSetup, bool value = true) #

Sets ExcelSheetPageSetup.DifferentOddEven: Whether even pages use their own header and footer. Turning it on copies the running header and footer into a missing even-page variant; existing even-page text is kept when it is turned off.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property                    // C# fluent
excelSheetPageSetup.DifferentOddEven = value;    excelSheetPageSetup.DifferentOddEven(value);
public static ExcelSheetPageSetup FitToHeight(ExcelSheetPageSetup excelSheetPageSetup, uint? value) #

Sets ExcelSheetPageSetup.FitToHeight: Pages to fit vertically when fit-to-page is on; null when it is off. Setting a value turns fit-to-page on. An omitted dimension defaults to one; zero leaves the axis unlimited.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value uint? required
The value.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property               // C# fluent
excelSheetPageSetup.FitToHeight = value;    excelSheetPageSetup.FitToHeight(value);
public static ExcelSheetPageSetup FitToWidth(ExcelSheetPageSetup excelSheetPageSetup, uint? value) #

Sets ExcelSheetPageSetup.FitToWidth: Pages to fit horizontally when fit-to-page is on; null when it is off. Setting a value turns fit-to-page on. An omitted dimension defaults to one; zero leaves the axis unlimited.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value uint? required
The value.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property              // C# fluent
excelSheetPageSetup.FitToWidth = value;    excelSheetPageSetup.FitToWidth(value);
public static ExcelSheetPageSetup HorizontalCentered(ExcelSheetPageSetup excelSheetPageSetup, bool value = true) #

Sets ExcelSheetPageSetup.HorizontalCentered: Whether the printed sheet is centered horizontally on the page.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property                      // C# fluent
excelSheetPageSetup.HorizontalCentered = value;    excelSheetPageSetup.HorizontalCentered(value);
Margins 2 overloads
public static ExcelSheetPageSetup Margins(ExcelSheetPageSetup excelSheetPageSetup, OfficeLength left, OfficeLength right, OfficeLength top, OfficeLength bottom, OfficeLength? header = null, OfficeLength? footer = null) #

Sets physical page margins. Omitted header and footer margins are 0.3 inches.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
left OfficeIMO.OfficeLength required
The value.
right OfficeIMO.OfficeLength required
The value.
top OfficeIMO.OfficeLength required
The value.
bottom OfficeIMO.OfficeLength required
The value.
header OfficeIMO.OfficeLength? = null optional
The value.
footer OfficeIMO.OfficeLength? = null optional
The value.

Returns

ExcelSheetPageSetup The same instance.
public static ExcelSheetPageSetup Margins(ExcelSheetPageSetup excelSheetPageSetup, ExcelMarginPreset preset) #

Sets the margins of one of Excel's margin presets.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
preset OfficeIMO.Excel.ExcelMarginPreset required
The value.

Returns

ExcelSheetPageSetup The same instance.
public static ExcelSheetPageSetup Orientation(ExcelSheetPageSetup excelSheetPageSetup, OfficePageOrientation? value) #

Sets ExcelSheetPageSetup.Orientation: Page orientation; null when the worksheet does not store one (Excel prints portrait).

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value OfficeIMO.OfficePageOrientation? required
The value.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property               // C# fluent
excelSheetPageSetup.Orientation = value;    excelSheetPageSetup.Orientation(value);
public static ExcelSheetPageSetup PageOrder(ExcelSheetPageSetup excelSheetPageSetup, ExcelPageOrder? value) #

Sets ExcelSheetPageSetup.PageOrder: Order in which multi-page sheets print; null when none is stored.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value OfficeIMO.Excel.ExcelPageOrder? required
The value.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property             // C# fluent
excelSheetPageSetup.PageOrder = value;    excelSheetPageSetup.PageOrder(value);
public static ExcelSheetPageSetup PaperSize(ExcelSheetPageSetup excelSheetPageSetup, ExcelPaperSize? value) #

Sets ExcelSheetPageSetup.PaperSize: Known paper size; null when none is stored or the stored code has no ExcelPaperSize value.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value OfficeIMO.Excel.ExcelPaperSize? required
The value.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property             // C# fluent
excelSheetPageSetup.PaperSize = value;    excelSheetPageSetup.PaperSize(value);
public static ExcelSheetPageSetup PrintArea(ExcelSheetPageSetup excelSheetPageSetup, string? value) #

Sets ExcelSheetPageSetup.PrintArea: Print area as stored, with one or more comma-separated areas; null when none is set. Setting null removes it.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value string? required
The value.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property             // C# fluent
excelSheetPageSetup.PrintArea = value;    excelSheetPageSetup.PrintArea(value);
public static ExcelSheetPageSetup PrintGridLines(ExcelSheetPageSetup excelSheetPageSetup, bool value = true) #

Sets ExcelSheetPageSetup.PrintGridLines: Whether cell gridlines print.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property                  // C# fluent
excelSheetPageSetup.PrintGridLines = value;    excelSheetPageSetup.PrintGridLines(value);
public static ExcelSheetPageSetup PrintHeadings(ExcelSheetPageSetup excelSheetPageSetup, bool value = true) #

Sets ExcelSheetPageSetup.PrintHeadings: Whether row and column headings print.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property                 // C# fluent
excelSheetPageSetup.PrintHeadings = value;    excelSheetPageSetup.PrintHeadings(value);
public static ExcelSheetPageSetup PrintTitles(ExcelSheetPageSetup excelSheetPageSetup, int? firstRow, int? lastRow, int? firstColumn = null, int? lastColumn = null) #

Sets the rows and columns repeated on every printed page; nulls on both axes clear them.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
firstRow int? required
The value.
lastRow int? required
The value.
firstColumn int? = null optional
The value.
lastColumn int? = null optional
The value.

Returns

ExcelSheetPageSetup The same instance.
public static ExcelSheetPageSetup Scale(ExcelSheetPageSetup excelSheetPageSetup, uint? value) #

Sets ExcelSheetPageSetup.Scale: Manual print scale percentage (10-400); null when none is stored.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value uint? required
The value.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property         // C# fluent
excelSheetPageSetup.Scale = value;    excelSheetPageSetup.Scale(value);
public static ExcelSheetPageSetup ScaleHeaderFooterWithDocument(ExcelSheetPageSetup excelSheetPageSetup, bool value = true) #

Sets ExcelSheetPageSetup.ScaleHeaderFooterWithDocument: Whether headers and footers scale with the document.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property                                 // C# fluent
excelSheetPageSetup.ScaleHeaderFooterWithDocument = value;    excelSheetPageSetup.ScaleHeaderFooterWithDocument(value);
public static ExcelSheetPageSetup VerticalCentered(ExcelSheetPageSetup excelSheetPageSetup, bool value = true) #

Sets ExcelSheetPageSetup.VerticalCentered: Whether the printed sheet is centered vertically on the page.

Parameters

excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ExcelSheetPageSetup The same instance.

Examples

// C# initializer or property                    // C# fluent
excelSheetPageSetup.VerticalCentered = value;    excelSheetPageSetup.VerticalCentered(value);