Private Sub SetPrinter(ByVal xx As Integer, ByVal yy As Integer)
With Printer
.FontName = "宋体"
.FontSize = 13
.PaperSize = 256 'vbPRPSUser ' 有没有试过将这一句提前
.ScaleMode = vbMillimeters '毫米
.Width = xx
.Height = yy
.CurrentX = 0
.CurrentY = 0
End With
End Sub
With Printer
.FontName = "宋体"
.FontSize = 13
.PaperSize = 256 'vbPRPSUser ' 有没有试过将这一句提前
.ScaleMode = vbMillimeters '毫米
.Width = xx
.Height = yy
.CurrentX = 0
.CurrentY = 0
End With
End Sub
偶然间,将设置纸张大小增大了100倍(原来的的大小参分别为:151,169,按照毫米单位设置),结果竟然打出来了.仍然很迷惑,是不是纸张大小只能采用vb默认的twip,而打印格式中的做标值却采用了毫米?
谢谢xqchang()的关注!
~~~~~~~~~~~~~~~~~~~~~~~~~~~
objects, not available at design time.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.....Printer object — the physical dimensions of the paper set up for the printing device; not available at design time. If set at run time, values in these properties are used instead of the setting of the PaperSize property.对这句话不太理解,是否是这个原因呢?
.Width = .ScaleX(xx, vbMillimeters, vbTwips)
.Height = .ScaleX(yy, vbMillimeters, vbTwips)
有位哥们告诉我在2000用API下解决了,但是还是不能用到98里去。想看看2000是怎样搞的请到这里去一下:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q282474#2
to:xqchang() 试过了,不行
to:xqchang() 这种方法可能有效,但是还没有验证一下,有空我就琢磨一下
to:xqchang() 试过了,不行
to:xqchang() 这种方法可能有效,但是还没有验证一下,有空我就琢磨一下
分怎么给,我怎么给不出去?