# ExcelSheetPageSetupFluent

The fluent methods of ExcelSheetPageSetup, generated from its public properties: A property-named method sets a property and a singular-named method adds…

Class 

`OfficeIMO.Excel`

**Namespace**

`OfficeIMO.Excel`

**Assembly**

`OfficeIMO.Excel`

**Modifiers**

static

The fluent methods of [ExcelSheetPageSetup](/api/excel/officeimo-excel-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

Filter members 

Show inherited

## Methods

`public static ExcelSheetPageSetup AlignHeaderFooterWithMargins(ExcelSheetPageSetup excelSheetPageSetup, bool value = true)` [#](#method-alignheaderfooterwithmargins-officeimo-excel-excelsheetpagesetup-boolean)

Sets [ExcelSheetPageSetup.AlignHeaderFooterWithMargins](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// C# initializer or property                                // C# fluent
excelSheetPageSetup.AlignHeaderFooterWithMargins = value;    excelSheetPageSetup.AlignHeaderFooterWithMargins(value);
```

`public static ExcelSheetPageSetup DifferentFirstPage(ExcelSheetPageSetup excelSheetPageSetup, bool value = true)` [#](#method-differentfirstpage-officeimo-excel-excelsheetpagesetup-boolean)

Sets [ExcelSheetPageSetup.DifferentFirstPage](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// C# initializer or property                      // C# fluent
excelSheetPageSetup.DifferentFirstPage = value;    excelSheetPageSetup.DifferentFirstPage(value);
```

`public static ExcelSheetPageSetup DifferentOddEven(ExcelSheetPageSetup excelSheetPageSetup, bool value = true)` [#](#method-differentoddeven-officeimo-excel-excelsheetpagesetup-boolean)

Sets [ExcelSheetPageSetup.DifferentOddEven](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// C# initializer or property                    // C# fluent
excelSheetPageSetup.DifferentOddEven = value;    excelSheetPageSetup.DifferentOddEven(value);
```

`public static ExcelSheetPageSetup FitToHeight(ExcelSheetPageSetup excelSheetPageSetup, uint? value)` [#](#method-fittoheight-officeimo-excel-excelsheetpagesetup-nullable-system-uint32)

Sets [ExcelSheetPageSetup.FitToHeight](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// C# initializer or property               // C# fluent
excelSheetPageSetup.FitToHeight = value;    excelSheetPageSetup.FitToHeight(value);
```

`public static ExcelSheetPageSetup FitToWidth(ExcelSheetPageSetup excelSheetPageSetup, uint? value)` [#](#method-fittowidth-officeimo-excel-excelsheetpagesetup-nullable-system-uint32)

Sets [ExcelSheetPageSetup.FitToWidth](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// C# initializer or property              // C# fluent
excelSheetPageSetup.FitToWidth = value;    excelSheetPageSetup.FitToWidth(value);
```

`public static ExcelSheetPageSetup HorizontalCentered(ExcelSheetPageSetup excelSheetPageSetup, bool value = true)` [#](#method-horizontalcentered-officeimo-excel-excelsheetpagesetup-boolean)

Sets [ExcelSheetPageSetup.HorizontalCentered](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// 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)` [#](#member-0e1cca0e546c247e37c91c03)

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)` [#](#method-margins-officeimo-excel-excelsheetpagesetup-officeimo-excel-excelmarginpreset)

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)` [#](#method-orientation-officeimo-excel-excelsheetpagesetup-nullable-officeimo-officepageorientation)

Sets [ExcelSheetPageSetup.Orientation](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// C# initializer or property               // C# fluent
excelSheetPageSetup.Orientation = value;    excelSheetPageSetup.Orientation(value);
```

`public static ExcelSheetPageSetup PageOrder(ExcelSheetPageSetup excelSheetPageSetup, ExcelPageOrder? value)` [#](#method-pageorder-officeimo-excel-excelsheetpagesetup-nullable-officeimo-excel-excelpageorder)

Sets [ExcelSheetPageSetup.PageOrder](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// C# initializer or property             // C# fluent
excelSheetPageSetup.PageOrder = value;    excelSheetPageSetup.PageOrder(value);
```

`public static ExcelSheetPageSetup PaperSize(ExcelSheetPageSetup excelSheetPageSetup, ExcelPaperSize? value)` [#](#method-papersize-officeimo-excel-excelsheetpagesetup-nullable-officeimo-excel-excelpapersize)

Sets [ExcelSheetPageSetup.PaperSize](/api/excel/officeimo-excel-excelsheetpagesetup/): Known paper size; null when none is stored or the stored code has no [ExcelPaperSize](/api/excel/officeimo-excel-excelpapersize/) value.

Parameters

**excelSheetPageSetup OfficeIMO.Excel.ExcelSheetPageSetup required**

The instance.

**value OfficeIMO.Excel.ExcelPaperSize? required**

The value.

Returns

`ExcelSheetPageSetup` The same instance.

Examples

```csharp
// C# initializer or property             // C# fluent
excelSheetPageSetup.PaperSize = value;    excelSheetPageSetup.PaperSize(value);
```

`public static ExcelSheetPageSetup PrintArea(ExcelSheetPageSetup excelSheetPageSetup, string? value)` [#](#method-printarea-officeimo-excel-excelsheetpagesetup-string)

Sets [ExcelSheetPageSetup.PrintArea](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// C# initializer or property             // C# fluent
excelSheetPageSetup.PrintArea = value;    excelSheetPageSetup.PrintArea(value);
```

`public static ExcelSheetPageSetup PrintGridLines(ExcelSheetPageSetup excelSheetPageSetup, bool value = true)` [#](#method-printgridlines-officeimo-excel-excelsheetpagesetup-boolean)

Sets [ExcelSheetPageSetup.PrintGridLines](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// C# initializer or property                  // C# fluent
excelSheetPageSetup.PrintGridLines = value;    excelSheetPageSetup.PrintGridLines(value);
```

`public static ExcelSheetPageSetup PrintHeadings(ExcelSheetPageSetup excelSheetPageSetup, bool value = true)` [#](#method-printheadings-officeimo-excel-excelsheetpagesetup-boolean)

Sets [ExcelSheetPageSetup.PrintHeadings](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// 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)` [#](#method-printtitles-officeimo-excel-excelsheetpagesetup-nullable-system-int32-nullable-system-int32-nullable-system-int32-nullable-system-int32)

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)` [#](#method-scale-officeimo-excel-excelsheetpagesetup-nullable-system-uint32)

Sets [ExcelSheetPageSetup.Scale](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// C# initializer or property         // C# fluent
excelSheetPageSetup.Scale = value;    excelSheetPageSetup.Scale(value);
```

`public static ExcelSheetPageSetup ScaleHeaderFooterWithDocument(ExcelSheetPageSetup excelSheetPageSetup, bool value = true)` [#](#method-scaleheaderfooterwithdocument-officeimo-excel-excelsheetpagesetup-boolean)

Sets [ExcelSheetPageSetup.ScaleHeaderFooterWithDocument](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

```csharp
// C# initializer or property                                 // C# fluent
excelSheetPageSetup.ScaleHeaderFooterWithDocument = value;    excelSheetPageSetup.ScaleHeaderFooterWithDocument(value);
```

`public static ExcelSheetPageSetup VerticalCentered(ExcelSheetPageSetup excelSheetPageSetup, bool value = true)` [#](#method-verticalcentered-officeimo-excel-excelsheetpagesetup-boolean)

Sets [ExcelSheetPageSetup.VerticalCentered](/api/excel/officeimo-excel-excelsheetpagesetup/): 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

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

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:C3F6647C1101EE70CF8BF241E04D8928861EE9FB6FC529F6A39189201C689082 -->
