用API打开打印对话框
声明:
Declare Function PRINTDLG Lib "comdlg32.dll" Alias _
"PrintDlgA" (pPrintdlg As PRINTDLG) As Long
Type PRINTDLG
lStructSize As Long
hwndOwner As Long
hDevMode As Long
hDevNames As Long
hdc As Long
flags As Long
nFromPage As Integer
nToPage As Integer
nMinPage As Integer
nMaxPage As Integer
nCopies As Integer
hInstance As Long
lCustData As Long
lpfnPrintHook As Long
lpfnSetupHook As Long
lpPrintTemplateName As String
lpSetupTemplateName As String
hPrintTemplate As Long
hSetupTemplate As Long
End Type
使用:
Private Sub Command1_Click()
Dim p As PRINTDLG
p.lStructSize = Len(p)
p.hwndOwner = Me.hWnd
p.nFromPage = 1
p.nToPage = 1
p.nMinPage = 1
p.nMaxPage = 1
p.nCopies = 1
x = PRINTDLG(p)
Printer.Print Text1.Text
End Sub
Tags:
作者:佚名评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论