V
veerleverbr
Hi,
Can anyone give me sample code on how to use de info in PrtDevMode en
PrtDevNames of Access from within VB.NET?
This is how it's done in VB6:
http://msdn.microsoft.com/library/d...s/vbaac11/html/acproPrtDevMode_HV05187912.asp
I tried redefining the type declarations in VB.NET using structures:
Private Structure str_DEVMODE
<VBFixedString(94)> Public RGB As String
End Structure
Private Structure type_DEVMODE
<VBFixedString(32)> Public strDeviceName As String
Public intSpecVersion As Integer
Public intDriverVersion As Integer
Public intSize As Integer
Public intDriverExtra As Integer
Public lngFields As Long
Public intOrientation As Integer
Public intPaperSize As Integer
Public intPaperLength As Integer
Public intPaperWidth As Integer
Public intScale As Integer
Public intCopies As Integer
Public intDefaultSource As Integer
Public intPrintQuality As Integer
Public intColor As Integer
Public intDuplex As Integer
Public intResolution As Integer
Public intTTOption As Integer
Public intCollate As Integer
<VBFixedString(32)> Public strFormName As String
Public lngPad As Long
Public lngBits As Long
Public lngPW As Long
Public lngPH As Long
Public lngDFI As Long
Public lngDFr As Long
End Structure
But now I have no idea how to get the info of rpt.PrtDevMode into these
structures... When I try to assign rpt.PrtDevMode to a String variable
like in the VB6 code, I get a cast error because rpt.PrtDevMode is an
array of bytes. So I tried converting that in a proper way using
BitConverter.ToString but that gives a different String as in VB6 so
that doesn't work.
Anyone knows how I can do that?
Veerle
Can anyone give me sample code on how to use de info in PrtDevMode en
PrtDevNames of Access from within VB.NET?
This is how it's done in VB6:
http://msdn.microsoft.com/library/d...s/vbaac11/html/acproPrtDevMode_HV05187912.asp
I tried redefining the type declarations in VB.NET using structures:
Private Structure str_DEVMODE
<VBFixedString(94)> Public RGB As String
End Structure
Private Structure type_DEVMODE
<VBFixedString(32)> Public strDeviceName As String
Public intSpecVersion As Integer
Public intDriverVersion As Integer
Public intSize As Integer
Public intDriverExtra As Integer
Public lngFields As Long
Public intOrientation As Integer
Public intPaperSize As Integer
Public intPaperLength As Integer
Public intPaperWidth As Integer
Public intScale As Integer
Public intCopies As Integer
Public intDefaultSource As Integer
Public intPrintQuality As Integer
Public intColor As Integer
Public intDuplex As Integer
Public intResolution As Integer
Public intTTOption As Integer
Public intCollate As Integer
<VBFixedString(32)> Public strFormName As String
Public lngPad As Long
Public lngBits As Long
Public lngPW As Long
Public lngPH As Long
Public lngDFI As Long
Public lngDFr As Long
End Structure
But now I have no idea how to get the info of rpt.PrtDevMode into these
structures... When I try to assign rpt.PrtDevMode to a String variable
like in the VB6 code, I get a cast error because rpt.PrtDevMode is an
array of bytes. So I tried converting that in a proper way using
BitConverter.ToString but that gives a different String as in VB6 so
that doesn't work.
Anyone knows how I can do that?
Veerle