hallo,
Wenn ich mir Adressdatensätze aus einem Listview ausdrucken lasse, wechselt der Mauszeiger zur Sanduhr.
Das Problem ist, das die Sanduhr nicht mehr weggeht(so als ob da noch irgendwas am erbeiten ist).
Trotzdem kann ich aber die MSGbox und auch das form per mausklick schliessen.
Ich hab in meinem Programm an einer anderen Stelle noch eine Druckroutine. dort taucht das Problem nicht auf.
hier mal mein Code
Private Sub cmd_druck_Click()
Dim anz As Integer
Dim anz2 As Integer
Dim i As Integer
Dim fmt As String
Dim sRow As String
Dim Xpos As Long
Dim Ypos As Long
Dim Xpos1 As Long
Dim Ypos1 As Long
Dim ypostitel1 As Long
Dim ypostitel2 As Long
'-----------------nicht markierte Einträge aus Listview löschen----------------
neu:
anz2 = ListView1.ListItems.Count
For anz = 1 To anz2
If ListView1.ListItems.Item(anz).Checked = False Then
ListView1.ListItems.Remove anz
GoTo neu
End If
Next anz
'---------------- Listview ausdrucken----------------
Screen.MousePointer = 11
With Printer
.ScaleMode = 6 ' Maßeinheit "mm"
.Font.Name = "Arial"
.Font.Size = 14
Xpos = 10
Ypos = 10
Xpos1 = 280
.CurrentY = 15
.CurrentX = 10
.Font.Bold = True
.Orientation = vbPRORLandscape 'Querformat
ypostitel1 = .CurrentY - 3
Printer.Line (Xpos - 5, .CurrentY - 3)-(Xpos1, .CurrentY - 3)
.CurrentX = 10
.CurrentY = 15
Printer.Print "Patientenliste" & " - Stand " & Date & " (Seite 1)"
ypostitel2 = .CurrentY + 3
Printer.Line (Xpos - 5, .CurrentY + 3)-(Xpos1, .CurrentY + 3)
.CurrentY = .CurrentY + 3
'--------------------------------Tour 1 drucken
' ----------------------------------------------
fmt = "35|35|35|15|35|20|20|10|10|10|10|10|10|10" ' Format (
' Spaltenbreiten)
.Font.Bold = True
.Font.Size = 10
sRow = "Name|Vorname|Strasse|PLZ|Ort|T-Art|Ziel|Mo|Di|Mi|Do|Fr|Sa|So"
PrintRow Xpos, fmt, sRow
.Font.Bold = False
Printer.Line (Xpos - 5, .CurrentY + 3)-(Xpos1, .CurrentY + 3)
.CurrentY = .CurrentY + 5
For i = 1 To ListView1.ListItems.Count
With ListView1.ListItems(i)
sRow = .ListSubItems(1).Text & "|" & _
.ListSubItems(2).Text & "|" & _
.ListSubItems(3).Text & "|" & _
.ListSubItems(4).Text & "|" & _
.ListSubItems(5).Text & "|" & _
.ListSubItems(6).Text & "|" & _
.ListSubItems(7).Text & "|" & _
.ListSubItems(9).Text & "|" & _
.ListSubItems(10).Text & "|" & _
.ListSubItems(11).Text & "|" & _
.ListSubItems(12).Text & "|" & _
.ListSubItems(13).Text & "|" & _
.ListSubItems(14).Text & "|" & _
.ListSubItems(15)
End With
If .CurrentY > 185 Then
Ypos3 = .CurrentY
.FontBold = True
Printer.Line (Xpos - 5, ypostitel1)-(Xpos - 5, .CurrentY)
Printer.Line (Xpos1, ypostitel1)-(Xpos1, Ypos3)
.FontBold = False
.NewPage
.CurrentX = 10
.CurrentY = 15
.Font.Bold = True
.FontSize = 14
ypostitel1 = .CurrentY - 3
Printer.Line (Xpos - 5, .CurrentY - 3)-(Xpos1, .CurrentY - 3)
.CurrentX = 10
.CurrentY = 15
Printer.Print "Patientenliste" & " - Stand " & Date & " (Seite" & _
"2)" ' & vbCrLf
ypostitel2 = .CurrentY + 3
Printer.Line (Xpos - 5, .CurrentY + 3)-(Xpos1, .CurrentY + 3)
.Font.Size = 10
.FontBold = True
sRow = _
"Name|Vorname|Strasse|PLZ|Ort|T-Art|Ziel|Mo|Di|Mi|Do|Fr|Sa|So" & _
vbCrLf
.Font.Bold = False
.CurrentY = .CurrentY + 5
End If
PrintRow Xpos, fmt, sRow
Ypos3 = .CurrentY
Printer.Line (Xpos - 5, .CurrentY)-(Xpos1, .CurrentY)
Printer.Line (Xpos - 5, ypostitel1)-(Xpos - 5, .CurrentY)
Printer.Line (Xpos1, ypostitel1)-(Xpos1, Ypos3)
Next i
.EndDoc
End With
MsgBox "Patienten - Liste wird gedruckt!", 64, "Drucken...", , , 5 'msgbox
' nach 5 Sekunden schließen
End Sub wo ist mein Fehler? |