返回或者设置纸张的大小。Long 类型,可读写。可为下列 XlPaperSize 常量之一(某些打印机可能不支持所有的这些纸张大小)。常量 意义 xlPaperLetter Letter (8-1/2 in. x 11 in.) xlPaperLetterSmall Letter Small (8-1/2 in. x 11 in.) xlPaperTabloid Tabloid (11 in. x 17 in.) xlPaperLedger Ledger (17 in. x 11 in.) xlPaperLegal Legal (8-1/2 in. x 14 in.) xlPaperStatement Statement (5-1/2 in. x 8-1/2 in.) xlPaperExecutive Executive (7-1/2 in. x 10-1/2 in.) xlPaperA3 A3 (297 mm x 420 mm) xlPaperA4 A4 (210 mm x 297 mm) xlPaperA4Small A4 Small (210 mm x 297 mm) xlPaperA5 A5 (148 mm x 210 mm) xlPaperB4 B4 (250 mm x 354 mm) xlPaperB5 B5 (182 mm x 257 mm) xlPaperFolio Folio (8-1/2 in. x 13 in.) xlPaperQuarto Quarto (215 mm x 275 mm) xlPaper10x14 10 in. x 14 in. xlPaper11x17 11 in. x 17 in. xlPaperNote Note (8-1/2 in. x 11 in.) xlPaperEnvelope9 Envelope #9 (3-7/8 in. x 8-7/8 in.) xlPaperEnvelope10 Envelope #10 (4-1/8 in. x 9-1/2 in.) xlPaperEnvelope11 Envelope #11 (4-1/2 in. x 10-3/8 in.) xlPaperEnvelope12 Envelope #12 (4-1/2 in. x 11 in.) xlPaperEnvelope14 Envelope #14 (5 in. x 11-1/2 in.) xlPaperCsheet C size sheet xlPaperDsheet D size sheet xlPaperEsheet E size sheet xlPaperEnvelopeDL Envelope DL (110 mm x 220 mm) xlPaperEnvelopeC3 Envelope C3 (324 mm x 458 mm) xlPaperEnvelopeC4 Envelope C4 (229 mm x 324 mm) xlPaperEnvelopeC5 Envelope C5 (162 mm x 229 mm) xlPaperEnvelopeC6 Envelope C6 (114 mm x 162 mm) xlPaperEnvelopeC65 Envelope C65 (114 mm x 229 mm) xlPaperEnvelopeB4 Envelope B4 (250 mm x 353 mm) xlPaperEnvelopeB5 Envelope B5 (176 mm x 250 mm) xlPaperEnvelopeB6 Envelope B6 (176 mm x 125 mm) xlPaperEnvelopeItaly Envelope (110 mm x 230 mm) xlPaperEnvelopeMonarch Envelope Monarch (3-7/8 in. x 7-1/2 in.) xlPaperEnvelopePersonal Envelope (3-5/8 in. x 6-1/2 in.) xlPaperFanfoldUS U.S. Standard Fanfold (14-7/8 in. x 11 in.) xlPaperFanfoldStdGerman German Standard Fanfold (8-1/2 in. x 12 in.) xlPaperFanfoldLegalGerman German Legal Fanfold (8-1/2 in. x 13 in.) xlPaperUser 用户自定义
xlPaperLetter Letter (8-1/2 in. x 11 in.)
xlPaperLetterSmall Letter Small (8-1/2 in. x 11 in.)
xlPaperTabloid Tabloid (11 in. x 17 in.)
xlPaperLedger Ledger (17 in. x 11 in.)
xlPaperLegal Legal (8-1/2 in. x 14 in.)
xlPaperStatement Statement (5-1/2 in. x 8-1/2 in.)
xlPaperExecutive Executive (7-1/2 in. x 10-1/2 in.)
xlPaperA3 A3 (297 mm x 420 mm)
xlPaperA4 A4 (210 mm x 297 mm)
xlPaperA4Small A4 Small (210 mm x 297 mm)
xlPaperA5 A5 (148 mm x 210 mm)
xlPaperB4 B4 (250 mm x 354 mm)
xlPaperB5 B5 (182 mm x 257 mm)
xlPaperFolio Folio (8-1/2 in. x 13 in.)
xlPaperQuarto Quarto (215 mm x 275 mm)
xlPaper10x14 10 in. x 14 in.
xlPaper11x17 11 in. x 17 in.
xlPaperNote Note (8-1/2 in. x 11 in.)
xlPaperEnvelope9 Envelope #9 (3-7/8 in. x 8-7/8 in.)
xlPaperEnvelope10 Envelope #10 (4-1/8 in. x 9-1/2 in.)
xlPaperEnvelope11 Envelope #11 (4-1/2 in. x 10-3/8 in.)
xlPaperEnvelope12 Envelope #12 (4-1/2 in. x 11 in.)
xlPaperEnvelope14 Envelope #14 (5 in. x 11-1/2 in.)
xlPaperCsheet C size sheet
xlPaperDsheet D size sheet
xlPaperEsheet E size sheet
xlPaperEnvelopeDL Envelope DL (110 mm x 220 mm)
xlPaperEnvelopeC3 Envelope C3 (324 mm x 458 mm)
xlPaperEnvelopeC4 Envelope C4 (229 mm x 324 mm)
xlPaperEnvelopeC5 Envelope C5 (162 mm x 229 mm)
xlPaperEnvelopeC6 Envelope C6 (114 mm x 162 mm)
xlPaperEnvelopeC65 Envelope C65 (114 mm x 229 mm)
xlPaperEnvelopeB4 Envelope B4 (250 mm x 353 mm)
xlPaperEnvelopeB5 Envelope B5 (176 mm x 250 mm)
xlPaperEnvelopeB6 Envelope B6 (176 mm x 125 mm)
xlPaperEnvelopeItaly Envelope (110 mm x 230 mm)
xlPaperEnvelopeMonarch Envelope Monarch (3-7/8 in. x 7-1/2 in.)
xlPaperEnvelopePersonal Envelope (3-5/8 in. x 6-1/2 in.)
xlPaperFanfoldUS U.S. Standard Fanfold (14-7/8 in. x 11 in.)
xlPaperFanfoldStdGerman German Standard Fanfold (8-1/2 in. x 12 in.)
xlPaperFanfoldLegalGerman German Legal Fanfold (8-1/2 in. x 13 in.)
xlPaperUser 用户自定义
var
iCount, jCount: Integer;
XLApp: Variant;
Sheet: Variant;
XLApp.ActiveSheet.Application.CommandBars['Stop Recording'].Visible := False;
XLApp.ActiveSheet.Cells.Select;
XLApp.Selection.Borders[xlDiagonalDown].LineStyle := xlNone;
XLApp.Selection.Borders[xlDiagonalUp].LineStyle := xlNone; XLApp.Selection.Borders[xlEdgeLeft].LineStyle := xlContinuous;
XLApp.Selection.Borders[xlEdgeLeft].Weight := xlThin;
XLApp.Selection.Borders[xlEdgeLeft].ColorIndex := xlAutomatic; XLApp.Selection.Borders[xlEdgeTop].LineStyle := xlContinuous;
XLApp.Selection.Borders[xlEdgeTop].Weight := xlThin;
XLApp.Selection.Borders[xlEdgeTop].ColorIndex := xlAutomatic; XLApp.Selection.Borders[xlEdgeBottom].LineStyle := xlContinuous;
XLApp.Selection.Borders[xlEdgeBottom].Weight := xlThin;
XLApp.Selection.Borders[xlEdgeBottom].ColorIndex := xlAutomatic; XLApp.Selection.Borders[xlEdgeRight].LineStyle := xlContinuous;
XLApp.Selection.Borders[xlEdgeRight].Weight := xlThin;
XLApp.Selection.Borders[xlEdgeRight].ColorIndex := xlAutomatic; XLApp.Selection.Borders[xlInsideVertical].LineStyle := xlContinuous;
XLApp.Selection.Borders[xlInsideVertical].Weight := xlThin;
XLApp.Selection.Borders[xlInsideVertical].ColorIndex := xlAutomatic; XLApp.Selection.Borders[xlInsideHorizontal].LineStyle := xlContinuous;
XLApp.Selection.Borders[xlInsideHorizontal].Weight := xlThin;
XLApp.Selection.Borders[xlInsideHorizontal].ColorIndex := xlAutomatic; XLApp.Selection.RowHeight := 35.25;
XLApp.Selection.HorizontalAlignment := xlCenter;
XLApp.Selection.VerticalAlignment := xlCenter; XLApp.ActiveSheet.Rows['2:2'].Select;
XLApp.Selection.Insert[Shift:=xlDown];
XLApp.ActiveSheet.Range['A1:A2'].Select;
XLApp.Selection.Merge;
XLApp.ActiveSheet.Range['B1:B2'].Select;
XLApp.Selection.Merge;
XLApp.ActiveSheet.Range['C1:C2'].Select;
XLApp.Selection.Merge;
XLApp.ActiveSheet.Range['D1:D2'].Select;
XLApp.Selection.Merge;
XLApp.ActiveSheet.Range['E1:E2'].Select;
XLApp.Selection.Merge;
XLApp.ActiveSheet.Range['F1:F2'].Select;
XLApp.Selection.Merge; XLApp.ActiveSheet.Range['G2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '1';
XLApp.ActiveSheet.Range['H2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '2';
XLApp.ActiveSheet.Range['I2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '3';
XLApp.ActiveSheet.Range['J2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '4';
XLApp.ActiveSheet.Range['K2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '合计';
XLApp.ActiveSheet.Range['G1:K1'].Select;
XLApp.Selection.ClearContents;
XLApp.Selection.Merge;
XLApp.ActiveSheet.Range['G1'].Select;
XLApp.ActiveCell.FormulaR1C1 := '2001'; XLApp.ActiveSheet.Range['L2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '1';
XLApp.ActiveSheet.Range['M2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '2';
XLApp.ActiveSheet.Range['N2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '3';
XLApp.ActiveSheet.Range['O2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '4';
XLApp.ActiveSheet.Range['P2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '合计';
XLApp.ActiveSheet.Range['L1:P1'].Select;
XLApp.Selection.ClearContents;
XLApp.Selection.Merge;
XLApp.ActiveSheet.Range['L1'].Select;
XLApp.ActiveCell.FormulaR1C1 := '2002'; XLApp.ActiveSheet.Range['Q2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '1';
XLApp.ActiveSheet.Range['R2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '2';
XLApp.ActiveSheet.Range['S2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '3';
XLApp.ActiveSheet.Range['T2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '合计';
XLApp.ActiveSheet.Range['Q1:T1'].Select;
XLApp.Selection.ClearContents;
XLApp.Selection.Merge;
XLApp.ActiveSheet.Range['Q1'].Select;
XLApp.ActiveCell.FormulaR1C1 := '2003'; XLApp.ActiveSheet.Range['U2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '1';
XLApp.ActiveSheet.Range['V2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '2';
XLApp.ActiveSheet.Range['W2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '3';
XLApp.ActiveSheet.Range['X2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '4';
XLApp.ActiveSheet.Range['Y2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '5';
XLApp.ActiveSheet.Range['Z2'].Select;
XLApp.ActiveCell.FormulaR1C1 := '合计';
XLApp.ActiveSheet.Range['U1:Z1'].Select;
XLApp.Selection.ClearContents;
XLApp.Selection.Merge;
XLApp.ActiveSheet.Range['U1'].Select;
XLApp.ActiveCell.FormulaR1C1 := '2004'; XLApp.ActiveSheet.PageSetup.PrintTitleRows := '$1:$2';
XLApp.ActiveSheet.PageSetup.PrintTitleColumns := ''; XLApp.ActiveSheet.PageSetup.PrintArea := '';
XLApp.ActiveSheet.PageSetup.CenterHeader := '';
XLApp.ActiveSheet.PageSetup.RightHeader := '';
XLApp.ActiveSheet.PageSetup.LeftFooter := '';
XLApp.ActiveSheet.PageSetup.CenterFooter := '';
XLApp.ActiveSheet.PageSetup.RightFooter := '';
XLApp.ActiveSheet.PageSetup.LeftMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.75];
XLApp.ActiveSheet.PageSetup.RightMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.75];
XLApp.ActiveSheet.PageSetup.TopMargin := XLApp.ActiveSheet.Application.InchesToPoints[1];
XLApp.ActiveSheet.PageSetup.BottomMargin := XLApp.ActiveSheet.Application.InchesToPoints[1];
XLApp.ActiveSheet.PageSetup.HeaderMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.5];
XLApp.ActiveSheet.PageSetup.FooterMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.5];
XLApp.ActiveSheet.PageSetup.PrintHeadings := False;
XLApp.ActiveSheet.PageSetup.PrintGridlines := False;
XLApp.ActiveSheet.PageSetup.PrintComments := xlPrintNoComments; ;
XLApp.ActiveSheet.PageSetup.CenterHorizontally := False;
XLApp.ActiveSheet.PageSetup.CenterVertically := False;
XLApp.ActiveSheet.PageSetup.Orientation := xlPortrait;
XLApp.ActiveSheet.PageSetup.Draft := False;
XLApp.ActiveSheet.PageSetup.PaperSize := xlPaperA4;
XLApp.ActiveSheet.PageSetup.FirstPageNumber := xlAutomatic;
XLApp.ActiveSheet.PageSetup.Order := xlDownThenOver;
XLApp.ActiveSheet.PageSetup.BlackAndWhite := False;
XLApp.ActiveSheet.PageSetup.Zoom := 100;
XLApp.ActiveSheet.PageSetup.PrintErrors := xlPrintErrorsDisplayed;
;
XLApp.ActiveWindow.View := xlPageBreakPreview;
XLApp.ActiveWindow.Zoom := 75; XLApp.ActiveSheet.Columns['G:Z'].Select;
XLApp.ActiveSheet.Range['G2'].Activate ;
XLApp.Selection.ColumnWidth := 6.88; XLApp.ActiveSheet.PageSetup.PrintTitleRows := '$1:$2';
XLApp.ActiveSheet.PageSetup.PrintTitleColumns := '$A:$F'; XLApp.ActiveSheet.PageSetup.PrintArea := ''; XLApp.ActiveSheet.PageSetup.LeftHeader := '' ;
XLApp.ActiveSheet.PageSetup.CenterHeader := '';
XLApp.ActiveSheet.PageSetup.RightHeader := '';
XLApp.ActiveSheet.PageSetup.LeftFooter := '';
XLApp.ActiveSheet.PageSetup.CenterFooter := '';
XLApp.ActiveSheet.PageSetup.RightFooter := '';
XLApp.ActiveSheet.PageSetup.LeftMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.75];
XLApp.ActiveSheet.PageSetup.RightMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.75];
XLApp.ActiveSheet.PageSetup.TopMargin := XLApp.ActiveSheet.Application.InchesToPoints[1];
XLApp.ActiveSheet.PageSetup.BottomMargin := XLApp.ActiveSheet.Application.InchesToPoints[1];
XLApp.ActiveSheet.PageSetup.HeaderMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.5];
XLApp.ActiveSheet.PageSetup.FooterMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.5];
XLApp.ActiveSheet.PageSetup.PrintHeadings := False;
XLApp.ActiveSheet.PageSetup.PrintGridlines := False;
XLApp.ActiveSheet.PageSetup.PrintComments := xlPrintNoComments;
XLApp.ActiveSheet.PageSetup.CenterHorizontally := False;
XLApp.ActiveSheet.PageSetup.CenterVertically := False;
XLApp.ActiveSheet.PageSetup.Orientation := xlPortrait;
XLApp.ActiveSheet.PageSetup.Draft := False;
XLApp.ActiveSheet.PageSetup.PaperSize := xlPaperA4;
XLApp.ActiveSheet.PageSetup.FirstPageNumber := xlAutomatic;
XLApp.ActiveSheet.PageSetup.Order := xlDownThenOver;
XLApp.ActiveSheet.PageSetup.BlackAndWhite := False;
XLApp.ActiveSheet.PageSetup.Zoom := 100 ;
;
XLApp.ActiveSheet.PageSetup.PrintTitleRows := '$1:$2' ;
XLApp.ActiveSheet.PageSetup.PrintTitleColumns := '$A:$F' ;
;
XLApp.ActiveSheet.PageSetup.PrintArea := '' ;
;
XLApp.ActiveSheet.PageSetup.LeftHeader := '' ;
XLApp.ActiveSheet.PageSetup.CenterHeader := '' ;
XLApp.ActiveSheet.PageSetup.RightHeader := '' ;
XLApp.ActiveSheet.PageSetup.LeftFooter := '' ;
XLApp.ActiveSheet.PageSetup.CenterFooter := '' ;;
XLApp.ActiveSheet.PageSetup.RightFooter := '' ;
XLApp.ActiveSheet.PageSetup.LeftMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.748031496062992] ;
XLApp.ActiveSheet.PageSetup.RightMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.748031496062992] ;
XLApp.ActiveSheet.PageSetup.TopMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.984251968503937] ;
XLApp.ActiveSheet.PageSetup.BottomMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.984251968503937] ;
XLApp.ActiveSheet.PageSetup.HeaderMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.511811023622047] ;
XLApp.ActiveSheet.PageSetup.FooterMargin := XLApp.ActiveSheet.Application.InchesToPoints[0.511811023622047] ;;
XLApp.ActiveSheet.PageSetup.PrintHeadings := False ;
XLApp.ActiveSheet.PageSetup.PrintGridlines := False ;
XLApp.ActiveSheet.PageSetup.PrintComments := xlPrintNoComments ;
// XLApp.ActiveSheet.PageSetup.PrintQuality := 600 ;
XLApp.ActiveSheet.PageSetup.CenterHorizontally := False ;
XLApp.ActiveSheet.PageSetup.CenterVertically := False ;
XLApp.ActiveSheet.PageSetup.Orientation := xlLandscape ;
XLApp.ActiveSheet.PageSetup.Draft := False ;
XLApp.ActiveSheet.PageSetup.PaperSize := xlPaperA4 ;
XLApp.ActiveSheet.PageSetup.FirstPageNumber := xlAutomatic ;
XLApp.ActiveSheet.PageSetup.Order := xlDownThenOver ;
XLApp.ActiveSheet.PageSetup.BlackAndWhite := False ;
XLApp.ActiveSheet.PageSetup.Zoom := 100 ;
XLApp.ActiveSheet.PageSetup.PrintErrors := xlPrintErrorsDisplayed ;
; ;
XLApp.ActiveSheet.Range['L1:P1'].Select ;
;
XLApp.ActiveSheet.Columns['C:C'].ColumnWidth := 7.38 ;
XLApp.ActiveSheet.Columns['D:D'].ColumnWidth := 8.5 ;
XLApp.ActiveSheet.Columns['B:B'].ColumnWidth := 9 ;
XLApp.ActiveSheet.Columns['A:A'].ColumnWidth := 5;
XLApp.ActiveSheet.Columns['E:E'].ColumnWidth := 9.25 ; ;
XLApp.ActiveSheet.Columns['F:F'].ColumnWidth := 9.13 ;
XLApp.ActiveSheet.Columns['G:G'].ColumnWidth := 4.88 ;
XLApp.ActiveSheet.Columns['O:O'].ColumnWidth := 5.38 ;
XLApp.ActiveSheet.Columns['N:N'].ColumnWidth := 6.25 ;;
XLApp.ActiveSheet.Columns['M:M'].ColumnWidth := 6.25 ;
XLApp.ActiveSheet.Columns['I:I'].ColumnWidth := 6 ;
XLApp.ActiveSheet.Columns['H:H'].ColumnWidth := 6.5 ; ;
XLApp.ActiveSheet.Rows['1:1'].RowHeight := 30应该有你要的吧