设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 1569|回复: 2
打印 上一主题 下一主题

[报表] 样控制报表的打印边距和纸型啊

[复制链接]
跳转到指定楼层
1#
发表于 2004-9-28 19:50:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
怎样控制报表的打印边距和纸型啊,VBA怎么写啊,请指教
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2004-9-29 01:17:00 | 只看该作者
利用Printer 对象的ColorMode、Copies、Duplex、Orientation、PaperBin、PaperSize 属性设置应该基本满足要求!

你具体在帮助文档中详细看一看。

此为OFFICE-XP新增对象,2K无法使用.但如果要使用VBA加载自定义纸张,这个比较麻烦,代码十分复杂,要基本用到下列API函数,不推荐使用,除非你开发商业化软件Public Declare Function DeviceCapabilities Lib "winspool.drv" Alias "DeviceCapabilitiesA" _

                (ByVal lpDeviceName As String, ByVal lpPort As String, ByVal iIndex As Long, _

                lpOutput As Any, lpDevMode As Any) As LongPublic Declare Function AddForm Lib "winspool.drv" Alias "AddFormA" _

                (ByVal hPrinter As Long, ByVal Level As Long, pForm As Byte) As LongPublic Declare Function EnumForms Lib "winspool.drv" Alias "EnumFormsA" _

                (ByVal hPrinter As Long, ByVal Level As Long, ByRef pForm As Any, _

                ByVal cbBuf As Long, ByRef pcbNeeded As Long, _

                ByRef pcReturned As Long) As LongPublic Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA" _

                (ByVal pPrinterName As String, phPrinter As Long, ByVal pDefault As Long) As LongPublic Declare Function ClosePrinter Lib "winspool.drv" _

                                     (ByVal hPrinter As Long) As LongPublic Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _

                              (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
3#
发表于 2004-9-29 18:48:00 | 只看该作者
Dim stDocName As String

Dim prt As Printer

Set prt = Application.Printers(0)

prt.Orientation = acPRORLandscape

prt.BottomMargin = 800

prt.TopMargin = 1400

prt.LeftMargin = 700

prt.RightMargin = 400

prt.PaperSize = acPRPSA4stDocName = "一览表"

DoCmd.OpenReport stDocName, acPreview

Reports(stDocName).Printer = prt
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-11-16 16:40 , Processed in 0.090006 second(s), 27 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表