Using PrtDevMode en PrtDevNames of MS Access Scripting lib in VB.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • veerleverbr@hotmail.com

    #1

    Using PrtDevMode en PrtDevNames of MS Access Scripting lib in VB.NET

    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/de...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 intDriverVersio n 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 intDefaultSourc e 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.To String but that gives a different String as in VB6 so
    that doesn't work.

    Anyone knows how I can do that?

    Veerle

Working...