-
Notifications
You must be signed in to change notification settings - Fork 63
/
excel.pagelayout.yml
715 lines (667 loc) · 28.3 KB
/
excel.pagelayout.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
### YamlMime:TSType
name: Excel.PageLayout
uid: 'excel!Excel.PageLayout:class'
package: excel!
fullName: Excel.PageLayout
summary: >-
Represents layout and print settings that are not dependent on any printer-specific implementation. These settings
include margins, orientation, page numbering, title rows, and print area.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
type: class
properties:
- name: blackAndWhite
uid: 'excel!Excel.PageLayout#blackAndWhite:member'
package: excel!
fullName: blackAndWhite
summary: The worksheet's black and white print option.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'blackAndWhite: boolean;'
return:
type: boolean
- name: bottomMargin
uid: 'excel!Excel.PageLayout#bottomMargin:member'
package: excel!
fullName: bottomMargin
summary: The worksheet's bottom page margin to use for printing in points.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'bottomMargin: number;'
return:
type: number
- name: centerHorizontally
uid: 'excel!Excel.PageLayout#centerHorizontally:member'
package: excel!
fullName: centerHorizontally
summary: >-
The worksheet's center horizontally flag. This flag determines whether the worksheet will be centered horizontally
when it's printed.
remarks: >-
\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/54-worksheet/worksheet-page-layout.yaml
await Excel.run(async (context) => {
const farmSheet = context.workbook.worksheets.getItem("Print");
farmSheet.pageLayout.centerHorizontally = true;
farmSheet.pageLayout.centerVertically = true;
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'centerHorizontally: boolean;'
return:
type: boolean
- name: centerVertically
uid: 'excel!Excel.PageLayout#centerVertically:member'
package: excel!
fullName: centerVertically
summary: >-
The worksheet's center vertically flag. This flag determines whether the worksheet will be centered vertically
when it's printed.
remarks: >-
\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/54-worksheet/worksheet-page-layout.yaml
await Excel.run(async (context) => {
const farmSheet = context.workbook.worksheets.getItem("Print");
farmSheet.pageLayout.centerHorizontally = true;
farmSheet.pageLayout.centerVertically = true;
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'centerVertically: boolean;'
return:
type: boolean
- name: context
uid: 'excel!Excel.PageLayout#context:member'
package: excel!
fullName: context
summary: >-
The request context associated with the object. This connects the add-in's process to the Office host
application's process.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'context: RequestContext;'
return:
type: '<xref uid="excel!Excel.RequestContext:class" />'
- name: draftMode
uid: 'excel!Excel.PageLayout#draftMode:member'
package: excel!
fullName: draftMode
summary: 'The worksheet''s draft mode option. If `true`<!-- -->, the sheet will be printed without graphics.'
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'draftMode: boolean;'
return:
type: boolean
- name: firstPageNumber
uid: 'excel!Excel.PageLayout#firstPageNumber:member'
package: excel!
fullName: firstPageNumber
summary: The worksheet's first page number to print. A `null` value represents "auto" page numbering.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'firstPageNumber: number | "";'
return:
type: number | ""
- name: footerMargin
uid: 'excel!Excel.PageLayout#footerMargin:member'
package: excel!
fullName: footerMargin
summary: 'The worksheet''s footer margin, in points, for use when printing.'
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'footerMargin: number;'
return:
type: number
- name: headerMargin
uid: 'excel!Excel.PageLayout#headerMargin:member'
package: excel!
fullName: headerMargin
summary: 'The worksheet''s header margin, in points, for use when printing.'
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'headerMargin: number;'
return:
type: number
- name: headersFooters
uid: 'excel!Excel.PageLayout#headersFooters:member'
package: excel!
fullName: headersFooters
summary: Header and footer configuration for the worksheet.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'readonly headersFooters: Excel.HeaderFooterGroup;'
return:
type: '<xref uid="excel!Excel.HeaderFooterGroup:class" />'
- name: leftMargin
uid: 'excel!Excel.PageLayout#leftMargin:member'
package: excel!
fullName: leftMargin
summary: 'The worksheet''s left margin, in points, for use when printing.'
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'leftMargin: number;'
return:
type: number
- name: orientation
uid: 'excel!Excel.PageLayout#orientation:member'
package: excel!
fullName: orientation
summary: The worksheet's orientation of the page.
remarks: >-
\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/54-worksheet/worksheet-page-layout.yaml
await Excel.run(async (context) => {
const farmSheet = context.workbook.worksheets.getItem("Print");
farmSheet.pageLayout.orientation = Excel.PageOrientation.landscape;
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'orientation: Excel.PageOrientation | "Portrait" | "Landscape";'
return:
type: '<xref uid="excel!Excel.PageOrientation:enum" /> | "Portrait" | "Landscape"'
- name: paperSize
uid: 'excel!Excel.PageLayout#paperSize:member'
package: excel!
fullName: paperSize
summary: The worksheet's paper size of the page.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: >-
paperSize: Excel.PaperType | "Letter" | "LetterSmall" | "Tabloid" | "Ledger" | "Legal" | "Statement" |
"Executive" | "A3" | "A4" | "A4Small" | "A5" | "B4" | "B5" | "Folio" | "Quatro" | "Paper10x14" | "Paper11x17" |
"Note" | "Envelope9" | "Envelope10" | "Envelope11" | "Envelope12" | "Envelope14" | "Csheet" | "Dsheet" |
"Esheet" | "EnvelopeDL" | "EnvelopeC5" | "EnvelopeC3" | "EnvelopeC4" | "EnvelopeC6" | "EnvelopeC65" |
"EnvelopeB4" | "EnvelopeB5" | "EnvelopeB6" | "EnvelopeItaly" | "EnvelopeMonarch" | "EnvelopePersonal" |
"FanfoldUS" | "FanfoldStdGerman" | "FanfoldLegalGerman";
return:
type: >-
<xref uid="excel!Excel.PaperType:enum" /> | "Letter" | "LetterSmall" | "Tabloid" | "Ledger" | "Legal" |
"Statement" | "Executive" | "A3" | "A4" | "A4Small" | "A5" | "B4" | "B5" | "Folio" | "Quatro" | "Paper10x14" |
"Paper11x17" | "Note" | "Envelope9" | "Envelope10" | "Envelope11" | "Envelope12" | "Envelope14" | "Csheet" |
"Dsheet" | "Esheet" | "EnvelopeDL" | "EnvelopeC5" | "EnvelopeC3" | "EnvelopeC4" | "EnvelopeC6" | "EnvelopeC65"
| "EnvelopeB4" | "EnvelopeB5" | "EnvelopeB6" | "EnvelopeItaly" | "EnvelopeMonarch" | "EnvelopePersonal" |
"FanfoldUS" | "FanfoldStdGerman" | "FanfoldLegalGerman"
- name: printComments
uid: 'excel!Excel.PageLayout#printComments:member'
package: excel!
fullName: printComments
summary: Specifies if the worksheet's comments should be displayed when printing.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'printComments: Excel.PrintComments | "NoComments" | "EndSheet" | "InPlace";'
return:
type: '<xref uid="excel!Excel.PrintComments:enum" /> | "NoComments" | "EndSheet" | "InPlace"'
- name: printErrors
uid: 'excel!Excel.PageLayout#printErrors:member'
package: excel!
fullName: printErrors
summary: The worksheet's print errors option.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'printErrors: Excel.PrintErrorType | "AsDisplayed" | "Blank" | "Dash" | "NotAvailable";'
return:
type: '<xref uid="excel!Excel.PrintErrorType:enum" /> | "AsDisplayed" | "Blank" | "Dash" | "NotAvailable"'
- name: printGridlines
uid: 'excel!Excel.PageLayout#printGridlines:member'
package: excel!
fullName: printGridlines
summary: Specifies if the worksheet's gridlines will be printed.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'printGridlines: boolean;'
return:
type: boolean
- name: printHeadings
uid: 'excel!Excel.PageLayout#printHeadings:member'
package: excel!
fullName: printHeadings
summary: Specifies if the worksheet's headings will be printed.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'printHeadings: boolean;'
return:
type: boolean
- name: printOrder
uid: 'excel!Excel.PageLayout#printOrder:member'
package: excel!
fullName: printOrder
summary: The worksheet's page print order option. This specifies the order to use for processing the page number printed.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'printOrder: Excel.PrintOrder | "DownThenOver" | "OverThenDown";'
return:
type: '<xref uid="excel!Excel.PrintOrder:enum" /> | "DownThenOver" | "OverThenDown"'
- name: rightMargin
uid: 'excel!Excel.PageLayout#rightMargin:member'
package: excel!
fullName: rightMargin
summary: 'The worksheet''s right margin, in points, for use when printing.'
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'rightMargin: number;'
return:
type: number
- name: topMargin
uid: 'excel!Excel.PageLayout#topMargin:member'
package: excel!
fullName: topMargin
summary: 'The worksheet''s top margin, in points, for use when printing.'
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'topMargin: number;'
return:
type: number
- name: zoom
uid: 'excel!Excel.PageLayout#zoom:member'
package: excel!
fullName: zoom
summary: >-
The worksheet's print zoom options. The `PageLayoutZoomOptions` object must be set as a JSON object (use `x.zoom =
{...}` instead of `x.zoom.scale = ...`<!-- -->).
remarks: >-
\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/54-worksheet/worksheet-page-layout.yaml
await Excel.run(async (context) => {
const farmSheet = context.workbook.worksheets.getItem("Print");
farmSheet.pageLayout.zoom = { scale: 200 };
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'zoom: Excel.PageLayoutZoomOptions;'
return:
type: '<xref uid="excel!Excel.PageLayoutZoomOptions:interface" />'
methods:
- name: getPrintArea()
uid: 'excel!Excel.PageLayout#getPrintArea:member(1)'
package: excel!
fullName: getPrintArea()
summary: >-
Gets the `RangeAreas` object, comprising one or more rectangular ranges, that represents the print area for the
worksheet. If there is no print area, an `ItemNotFound` error will be thrown.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'getPrintArea(): Excel.RangeAreas;'
return:
type: '<xref uid="excel!Excel.RangeAreas:class" />'
description: ''
- name: getPrintAreaOrNullObject()
uid: 'excel!Excel.PageLayout#getPrintAreaOrNullObject:member(1)'
package: excel!
fullName: getPrintAreaOrNullObject()
summary: >-
Gets the `RangeAreas` object, comprising one or more rectangular ranges, that represents the print area for the
worksheet. If there is no print area, then this method returns an object with its `isNullObject` property set to
`true`<!-- -->. For further information, see [*OrNullObject methods and
properties](https://learn.microsoft.com/office/dev/add-ins/develop/application-specific-api-model#ornullobject-methods-and-properties)<!--
-->.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'getPrintAreaOrNullObject(): Excel.RangeAreas;'
return:
type: '<xref uid="excel!Excel.RangeAreas:class" />'
description: ''
- name: getPrintTitleColumns()
uid: 'excel!Excel.PageLayout#getPrintTitleColumns:member(1)'
package: excel!
fullName: getPrintTitleColumns()
summary: Gets the range object representing the title columns.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'getPrintTitleColumns(): Excel.Range;'
return:
type: '<xref uid="excel!Excel.Range:class" />'
description: ''
- name: getPrintTitleColumnsOrNullObject()
uid: 'excel!Excel.PageLayout#getPrintTitleColumnsOrNullObject:member(1)'
package: excel!
fullName: getPrintTitleColumnsOrNullObject()
summary: >-
Gets the range object representing the title columns. If not set, then this method returns an object with its
`isNullObject` property set to `true`<!-- -->. For further information, see [*OrNullObject methods and
properties](https://learn.microsoft.com/office/dev/add-ins/develop/application-specific-api-model#ornullobject-methods-and-properties)<!--
-->.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'getPrintTitleColumnsOrNullObject(): Excel.Range;'
return:
type: '<xref uid="excel!Excel.Range:class" />'
description: ''
- name: getPrintTitleRows()
uid: 'excel!Excel.PageLayout#getPrintTitleRows:member(1)'
package: excel!
fullName: getPrintTitleRows()
summary: Gets the range object representing the title rows.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'getPrintTitleRows(): Excel.Range;'
return:
type: '<xref uid="excel!Excel.Range:class" />'
description: ''
- name: getPrintTitleRowsOrNullObject()
uid: 'excel!Excel.PageLayout#getPrintTitleRowsOrNullObject:member(1)'
package: excel!
fullName: getPrintTitleRowsOrNullObject()
summary: >-
Gets the range object representing the title rows. If not set, then this method returns an object with its
`isNullObject` property set to `true`<!-- -->. For further information, see [*OrNullObject methods and
properties](https://learn.microsoft.com/office/dev/add-ins/develop/application-specific-api-model#ornullobject-methods-and-properties)<!--
-->.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'getPrintTitleRowsOrNullObject(): Excel.Range;'
return:
type: '<xref uid="excel!Excel.Range:class" />'
description: ''
- name: load(options)
uid: 'excel!Excel.PageLayout#load:member(1)'
package: excel!
fullName: load(options)
summary: >-
Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading
the properties.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'load(options?: Excel.Interfaces.PageLayoutLoadOptions): Excel.PageLayout;'
parameters:
- id: options
description: Provides options for which properties of the object to load.
type: '<xref uid="excel!Excel.Interfaces.PageLayoutLoadOptions:interface" />'
return:
type: '<xref uid="excel!Excel.PageLayout:class" />'
description: ''
- name: load(propertyNames)
uid: 'excel!Excel.PageLayout#load:member(2)'
package: excel!
fullName: load(propertyNames)
summary: >-
Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading
the properties.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'load(propertyNames?: string | string[]): Excel.PageLayout;'
parameters:
- id: propertyNames
description: A comma-delimited string or an array of strings that specify the properties to load.
type: 'string | string[]'
return:
type: '<xref uid="excel!Excel.PageLayout:class" />'
description: ''
- name: load(propertyNamesAndPaths)
uid: 'excel!Excel.PageLayout#load:member(3)'
package: excel!
fullName: load(propertyNamesAndPaths)
summary: >-
Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading
the properties.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: |-
load(propertyNamesAndPaths?: {
select?: string;
expand?: string;
}): Excel.PageLayout;
parameters:
- id: propertyNamesAndPaths
description: >-
`propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and
`propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load.
type: |-
{
select?: string;
expand?: string;
}
return:
type: '<xref uid="excel!Excel.PageLayout:class" />'
description: ''
- name: 'set(properties, options)'
uid: 'excel!Excel.PageLayout#set:member(1)'
package: excel!
fullName: 'set(properties, options)'
summary: >-
Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate
properties, or another API object of the same type.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'set(properties: Interfaces.PageLayoutUpdateData, options?: OfficeExtension.UpdateOptions): void;'
parameters:
- id: properties
description: >-
A JavaScript object with properties that are structured isomorphically to the properties of the object on
which the method is called.
type: '<xref uid="excel!Excel.Interfaces.PageLayoutUpdateData:interface" />'
- id: options
description: Provides an option to suppress errors if the properties object tries to set any read-only properties.
type: '<xref uid="office!OfficeExtension.UpdateOptions:interface" />'
return:
type: void
description: ''
- name: set(properties)
uid: 'excel!Excel.PageLayout#set:member(2)'
package: excel!
fullName: set(properties)
summary: 'Sets multiple properties on the object at the same time, based on an existing loaded object.'
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'set(properties: Excel.PageLayout): void;'
parameters:
- id: properties
description: ''
type: '<xref uid="excel!Excel.PageLayout:class" />'
return:
type: void
description: ''
- name: setPrintArea(printArea)
uid: 'excel!Excel.PageLayout#setPrintArea:member(1)'
package: excel!
fullName: setPrintArea(printArea)
summary: Sets the worksheet's print area.
remarks: >-
\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/54-worksheet/worksheet-page-layout.yaml
await Excel.run(async (context) => {
const farmSheet = context.workbook.worksheets.getItem("Print");
farmSheet.pageLayout.setPrintArea("A1:D41");
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'setPrintArea(printArea: Range | RangeAreas | string): void;'
parameters:
- id: printArea
description: The range or ranges of the content to print.
type: '<xref uid="excel!Excel.Range:class" /> | <xref uid="excel!Excel.RangeAreas:class" /> | string'
return:
type: void
description: ''
- name: 'setPrintMargins(unit, marginOptions)'
uid: 'excel!Excel.PageLayout#setPrintMargins:member(1)'
package: excel!
fullName: 'setPrintMargins(unit, marginOptions)'
summary: Sets the worksheet's page margins with units.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'setPrintMargins(unit: Excel.PrintMarginUnit, marginOptions: Excel.PageLayoutMarginOptions): void;'
parameters:
- id: unit
description: Measurement unit for the margins provided.
type: '<xref uid="excel!Excel.PrintMarginUnit:enum" />'
- id: marginOptions
description: Margin values to set. Margins not provided remain unchanged.
type: '<xref uid="excel!Excel.PageLayoutMarginOptions:interface" />'
return:
type: void
description: ''
- name: 'setPrintMargins(unitString, marginOptions)'
uid: 'excel!Excel.PageLayout#setPrintMargins:member(2)'
package: excel!
fullName: 'setPrintMargins(unitString, marginOptions)'
summary: Sets the worksheet's page margins with units.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: >-
setPrintMargins(unitString: "Points" | "Inches" | "Centimeters", marginOptions: Excel.PageLayoutMarginOptions):
void;
parameters:
- id: unitString
description: Measurement unit for the margins provided.
type: '"Points" | "Inches" | "Centimeters"'
- id: marginOptions
description: Margin values to set. Margins not provided remain unchanged.
type: '<xref uid="excel!Excel.PageLayoutMarginOptions:interface" />'
return:
type: void
description: ''
- name: setPrintTitleColumns(printTitleColumns)
uid: 'excel!Excel.PageLayout#setPrintTitleColumns:member(1)'
package: excel!
fullName: setPrintTitleColumns(printTitleColumns)
summary: Sets the columns that contain the cells to be repeated at the left of each page of the worksheet for printing.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'setPrintTitleColumns(printTitleColumns: Range | string): void;'
parameters:
- id: printTitleColumns
description: The columns to be repeated to the left of each page. The range must span the entire column to be valid.
type: '<xref uid="excel!Excel.Range:class" /> | string'
return:
type: void
description: ''
- name: setPrintTitleRows(printTitleRows)
uid: 'excel!Excel.PageLayout#setPrintTitleRows:member(1)'
package: excel!
fullName: setPrintTitleRows(printTitleRows)
summary: Sets the rows that contain the cells to be repeated at the top of each page of the worksheet for printing.
remarks: >-
\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/54-worksheet/worksheet-page-layout.yaml
await Excel.run(async (context) => {
const farmSheet = context.workbook.worksheets.getItem("Print");
farmSheet.pageLayout.setPrintTitleRows("$1:$1");
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'setPrintTitleRows(printTitleRows: Range | string): void;'
parameters:
- id: printTitleRows
description: The rows to be repeated at the top of each page. The range must span the entire row to be valid.
type: '<xref uid="excel!Excel.Range:class" /> | string'
return:
type: void
description: ''
- name: toJSON()
uid: 'excel!Excel.PageLayout#toJSON:member(1)'
package: excel!
fullName: toJSON()
summary: >-
Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to
`JSON.stringify()`<!-- -->. (`JSON.stringify`<!-- -->, in turn, calls the `toJSON` method of the object that is
passed to it.) Whereas the original Excel.PageLayout object is an API object, the `toJSON` method returns a plain
JavaScript object (typed as `Excel.Interfaces.PageLayoutData`<!-- -->) that contains shallow copies of any loaded
child properties from the original object.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'toJSON(): Excel.Interfaces.PageLayoutData;'
return:
type: '<xref uid="excel!Excel.Interfaces.PageLayoutData:interface" />'
description: ''
extends: '<xref uid="office!OfficeExtension.ClientObject:class" />'