AccessTr.neT

Tam Versiyon: PrtDevMode kodu kullanımı
Şu anda arşiv modunu görüntülemektesiniz. Tam versiyonu görüntülemek için buraya tıklayınız.
Programı büyük ölçüde bitirdim. Fakat döküm kısmında sıkıntı yaşadım. Çünkü normal dökersen yazıcı A4 kabul ediyor kağıt boyutunda Custom özelliği de yok. Döküm yapılan kağıdın boyu 12 inç veya 30.48 cm genişliği 8 inç. Access 2007 yardım menüsünde PrtDevMode özelliği hakkında yardım var. Fakat kodun nasıl yazılacağını bulamadım. Yazıcım Epson FX 2190 ESC/P.
http://office.microsoft.com/en-us/access...41033.aspx
http://www.vbforums.com/archive/index.php/t-345367.html

linklerden yararlandım aşağıdaki kodları denedim yine olmadı
A4 döküyor ama ben 12X8 inç çıksın istiyorum.
Malum A4 210X297 cm o nedenle her kayıtta kaydırıyor.

Kod:
Option Compare Database

Private Type str_DEVMODE
RGB As String * 94
End Type

Private Type type_DEVMODE

strDeviceName As String * 32
intSpecVersion As Integer
intDriverVersion As Integer
intSize As Integer
intDriverExtra As Integer
lngFields As Long
intOrientation As Integer
intPaperSize As Integer
intPaperLength As Integer
intPaperWidth As Integer
intScale As Integer
intCopies As Integer
intDefaultSource As Integer
intPrintQuality As Integer
intColor As Integer
intDuplex As Integer
intResolution As Integer
intTTOption As Integer
intCollate As Integer
strFormName As String * 32
lngPad As Long
lngBits As Long
lngPW As Long
lngPH As Long
lngDFI As Long
lngDFr As Long
End Type

Private Sub Komut115_Click()

'Sayfa uzunluğu ve genişliğini ayarlama
Dim DevString As str_DEVMODE
Dim DM As type_DEVMODE
Dim strDevModeExtra As String
Dim rpt As Report
Dim intResponse As Integer



' Opens report in Design view.
DoCmd.OpenReport "AVANSDOKUM", acDesign
Set rpt = Reports("AVANSDOKUM")


If Not IsNull(rpt.PrtDevMode) Then
strDevModeExtra = rpt.PrtDevMode
' Gets current DEVMODE structure.
DevString.RGB = strDevModeExtra
LSet DM = DevString

If DM.intPaperSize = 256 Then
' Display user-defined size.
intResponse = MsgBox("The current custom page size is " & _
DM.intPaperWidth / 254 & " inches wide by " & _
DM.intPaperLength / 254 & " inches long. Do you want " & _
"to change the settings?", vbYesNo + vbQuestion)

Else

' Currently not user-defined.

intResponse = MsgBox("The report does not have a custom page size. " & _

"Do you want to define one?", vbYesNo + vbQuestion)

End If
If intResponse = vbYes Then

' User wants to change settings. Initialize fields.

DM.lngFields = DM.lngFields Or DM.intPaperSize Or _
DM.intPaperLength Or DM.intPaperWidth
' Set custom page.

DM.intPaperSize = 256

' Prompt for length and width.
DM.intPaperLength = 12 * 254
DM.intPaperWidth = 8 * 254

' Update property.

LSet DevString = DM
Mid(strDevModeExtra, 1, 94) = DevString.RGB
rpt.PrtDevMode = strDevModeExtra

End If

End If
Set rpt = Nothing

'DoCmd.Close acReport, "AVANSDOKUM", acSaveYes
DoCmd.PrintOut (AVANSDOKUM)

End Sub