Sub
druck()
Dim
intRow
As
Integer
, intLastRow
As
Integer
Dim
ASH
As
Worksheet, gesamt
As
Worksheet, unbetrachtet
As
Worksheet
Dim
x
As
Long
, y
As
Long
, lngZeilen
As
Long
Dim
V1, V2, V3, V4
Dim
appWord
As
Object
Dim
docTest
As
Object
Set
appWord = CreateObject(
"Word.Application"
)
Set
docTest = appWord.Documents.Add(
"C:\Dokumente und Einstellungen\\Desktop\druck.dot"
)
appWord.Visible =
True
With
ThisWorkbook
Set
ASH = .ActiveSheet
Set
gesamt = .Worksheets(
"liste"
)
End
With
lngZeilen = gesamt.Cells(gesamt.Rows.Count, 1).
End
(xlUp).Row
For
y = 2
To
lngZeilen
With
gesamt
V1 = .Cells(y, 1).Value
V2 = .Cells(y, 2).Value
V3 = .Cells(y, 3).Value
V4 = .Cells(y, 4).Value
End
With
If
V1 <>
""
And
V2 <>
""
And
V3 <>
""
And
V4 <>
""
Then
docTest.Activate
docTest.Bookmarks(
"kennzeichen"
).Range.Text = V1
docTest.Bookmarks(
"name"
).Range.Text = V2
docTest.Bookmarks(
"datum"
).Range.Text = V3
docTest.Bookmarks(
"uhrzeit"
).Range.Text = V4
docTest.PrintOut
docTest.Close
appWord.Quit
Set
docTest =
Nothing
Set
appWord =
Nothing
End
If
Next
y
End
Sub