在excel自定义纸张大小(50分)

  • 主题发起人 主题发起人 wei2003
  • 开始时间 开始时间
W

wei2003

Unregistered / Unconfirmed
GUEST, unregistred user!
我在我的打印机已经定义好一种新的纸张大小:my,然后我在转excel时怎么才能够认它的
papersize等于我自定义的纸张大小:my;用过程控制,分不多,请各位大侠赐教;
 
在win2k,excel怎么调用我自定义纸张大小的my,没人知道还是不可能做到
 
先定義好my 的長和寬:2150和1400然後調用以
sh1.pagesetup.papersize:=GetPaperno;
function GetPaperno:integer;
var
printername:string;
dwPapers: DWord;
lpwPapers: array[0..255] of Word;
papersize:array[0..63,0..1] of integer;
begin
result:=0;
printername:=printer.Printers[printer.PrinterIndex];
dwPapers:=DeviceCapabilities(PChar(PrinterName),'LPT1',DC_PAPERS,@lpwPapers,nil);
DeviceCapabilities(PChar(PrinterName),'LPT1',DC_PAPERsize,@Papersize,nil);
while (dwPapers > 0)do
begin
// showmessage('u:'+inttostr(Papersize[dwpapers,0]));
// showmessage('u:'+inttostr(Papersize[dwpapers,1]));
if (Papersize[dwpapers,0]=2150) and (Papersize[dwpapers,1]=1400) then
begin
result:=lpwPapers[dwPapers];
// showmessage(inttostr(lpwPapers[dwPapers]));
end;
{
case DWORD(lpwPapers[dwPapers]) of
DMPAPER_USER: showmessage(inttostr(lpwPapers[dwPapers]));
DMPAPER_A3: showmessage(inttostr(lpwPapers[dwPapers]));
DMPAPER_A4: showmessage(inttostr(DWORD(lpwPapers[dwPapers])));
DMPAPER_B5: showmessage(inttostr(lpwPapers[dwPapers]));
end;
}
dwPapers:=dwPapers-1;
end;
end;
 
接受答案了.
 
后退
顶部