J jackalwin Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-26 #1 通过OLE创建个Excel对象 xlapp:variant; ... 怎样通过这个Excel对象控制打印预览中打印纸张的大小和宽高
N newsmile Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-26 #2 with xlapp.ActiveSheet.PageSetup do begin PaperSize := xlPaperA3;//打印预览中的纸张设置就是页面设置,是否需要这种效果? LeftMargin := xlapp.InchesToPoints(0.748031496062992); RightMargin := xlapp.InchesToPoints(1.14173228346457); TopMargin := xlapp.InchesToPoints(1.18110236220472); BottomMargin := xlapp.InchesToPoints(0.984251968503937); end;
with xlapp.ActiveSheet.PageSetup do begin PaperSize := xlPaperA3;//打印预览中的纸张设置就是页面设置,是否需要这种效果? LeftMargin := xlapp.InchesToPoints(0.748031496062992); RightMargin := xlapp.InchesToPoints(1.14173228346457); TopMargin := xlapp.InchesToPoints(1.18110236220472); BottomMargin := xlapp.InchesToPoints(0.984251968503937); end;
Z zywcd Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-26 #3 正解。 刚才我测试的时候怎么都没有自定义纸张,设置xlPaperUser值的时候就会出错,不知道为什么
J jackalwin Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-26 #4 嗯 我也试过这种方法 不过也会出错 帮忙想想~
Z zywcd Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-26 #5 设置当然系统默认打印机支持的纸张大小,不会出错。我测试了。
J jackalwin Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-28 #6 编译未通过,报错:未经申报的标识符:xlPaperA3,我换了xlPaperA4也不行 是我需要添加什么单元么?
J jackalwin Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-28 #8 添加不了啊 alt+F11 添加啊~? 迷糊了~
J jackalwin Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-29 #10 是啊 我就在那添的 错误:file not found 'excel2000.dcu'
N newsmile Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-30 #11 这个单元文件的源码应该在Delphi的安装目录/OCX/Servers下,dcu文件在/Imports下。如果只是想引用纸型你可以在你的单元文件中加上 const xlPaper10x14 = $00000010; xlPaper11x17 = $00000011; xlPaperA3 = $00000008; xlPaperA4 = $00000009; xlPaperA4Small = $0000000A; xlPaperA5 = $0000000B; xlPaperB4 = $0000000C; xlPaperB5 = $0000000D; xlPaperCsheet = $00000018; xlPaperDsheet = $00000019; xlPaperEnvelope10 = $00000014; xlPaperEnvelope11 = $00000015; xlPaperEnvelope12 = $00000016; xlPaperEnvelope14 = $00000017; xlPaperEnvelope9 = $00000013; xlPaperEnvelopeB4 = $00000021; xlPaperEnvelopeB5 = $00000022; xlPaperEnvelopeB6 = $00000023; xlPaperEnvelopeC3 = $0000001D; xlPaperEnvelopeC4 = $0000001E; xlPaperEnvelopeC5 = $0000001C; xlPaperEnvelopeC6 = $0000001F; xlPaperEnvelopeC65 = $00000020; xlPaperEnvelopeDL = $0000001B; xlPaperEnvelopeItaly = $00000024; xlPaperEnvelopeMonarch = $00000025; xlPaperEnvelopePersonal = $00000026; xlPaperEsheet = $0000001A; xlPaperExecutive = $00000007; xlPaperFanfoldLegalGerman = $00000029; xlPaperFanfoldStdGerman = $00000028; xlPaperFanfoldUS = $00000027; xlPaperFolio = $0000000E; xlPaperLedger = $00000004; xlPaperLegal = $00000005; xlPaperLetter = $00000001; xlPaperLetterSmall = $00000002; xlPaperNote = $00000012; xlPaperQuarto = $0000000F; xlPaperStatement = $00000006; xlPaperTabloid = $00000003; xlPaperUser = $00000100;
这个单元文件的源码应该在Delphi的安装目录/OCX/Servers下,dcu文件在/Imports下。如果只是想引用纸型你可以在你的单元文件中加上 const xlPaper10x14 = $00000010; xlPaper11x17 = $00000011; xlPaperA3 = $00000008; xlPaperA4 = $00000009; xlPaperA4Small = $0000000A; xlPaperA5 = $0000000B; xlPaperB4 = $0000000C; xlPaperB5 = $0000000D; xlPaperCsheet = $00000018; xlPaperDsheet = $00000019; xlPaperEnvelope10 = $00000014; xlPaperEnvelope11 = $00000015; xlPaperEnvelope12 = $00000016; xlPaperEnvelope14 = $00000017; xlPaperEnvelope9 = $00000013; xlPaperEnvelopeB4 = $00000021; xlPaperEnvelopeB5 = $00000022; xlPaperEnvelopeB6 = $00000023; xlPaperEnvelopeC3 = $0000001D; xlPaperEnvelopeC4 = $0000001E; xlPaperEnvelopeC5 = $0000001C; xlPaperEnvelopeC6 = $0000001F; xlPaperEnvelopeC65 = $00000020; xlPaperEnvelopeDL = $0000001B; xlPaperEnvelopeItaly = $00000024; xlPaperEnvelopeMonarch = $00000025; xlPaperEnvelopePersonal = $00000026; xlPaperEsheet = $0000001A; xlPaperExecutive = $00000007; xlPaperFanfoldLegalGerman = $00000029; xlPaperFanfoldStdGerman = $00000028; xlPaperFanfoldUS = $00000027; xlPaperFolio = $0000000E; xlPaperLedger = $00000004; xlPaperLegal = $00000005; xlPaperLetter = $00000001; xlPaperLetterSmall = $00000002; xlPaperNote = $00000012; xlPaperQuarto = $0000000F; xlPaperStatement = $00000006; xlPaperTabloid = $00000003; xlPaperUser = $00000100;
W wtxwinner Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-30 #13 http://www.delphibbs.com/delphibbs/dispq.asp?lid=1211360