-
please help me!!!
I have to send a file to a printer or a fax, I'm using this cose:
Private dm As DEVMODE
Private pd As PDTYPE
Public hWndOwner As Long
Public pages As Integer
Public Sub ShowPrinter()
Dim iNull As Integer
Dim lpDM As Long
Dim sDevName As String
Dim objPrn As Printer
pd.lStructSize = 66
pd.hWndOwner = hWndOwner
pd.hDevMode = 0
pd.hDevNames = 0
pd.hDC = 0
pd.flags = 0
pd.nFromPage = 0
pd.nToPage = 0
pd.nMinPage = 0
If pages Then
pd.nMaxPage = pages - 1
End If
pd.nCopies = 0
If PrintDlgAPI(pd) Then
lpDM = GlobalLock(pd.hDevMode)
Call RtlMoveMemory(dm, ByVal lpDM, Len(dm))
lpDM = GlobalUnlock(pd.hDevMode)
iNull = InStr(dm.dmDeviceName, vbNullChar)
If iNull Then
sDevName = Left(CStr(dm.dmDeviceName), 13) 'vbNullChar)
Else
sDevName = dm.dmDeviceName
End If
For Each objPrn In Printers
If objPrn.DeviceName = sDevName Then
Set Printer = objPrn
Exit For
End If
Next
If pd.nCopies = 1 Then
Printer.Copies = dm.dmCopies
End If
End If
End Sub
BUT WHERE HAVE I TO PUT THE NAME OF THE FILE THAT HAVE TO BE SENT?????