Set
oExcelApp = CreateObject(
"Excel.Application"
)
Set
oExcelWorkbook = oExcelApp.Workbooks.Open(ThisDocument.Path & DatenBezug)
lZeile = 2
With
oExcelWorkbook.Sheets(DatEmpfaenger)
Do
While
.Cells(lZeile, 2) <>
""
If
ListBox1.Text =
CStr
(.Cells(lZeile, 1).Value)
Then
ActiveDocument.Bookmarks(
"TM_E_Firma"
).Range = _
CStr
(.Cells(lZeile, 3).Value)
ActiveDocument.Bookmarks(
"TM_E_StrHnr"
).Range = _
CStr
(.Cells(lZeile, 4).Value)
ActiveDocument.Bookmarks(
"TM_E_PLZ"
).Range = _
CStr
(.Cells(lZeile, 5).Value)
ActiveDocument.Bookmarks(
"TM_E_Ort"
).Range = _
CStr
(.Cells(lZeile, 6).Value)
ActiveDocument.Bookmarks(
"TM_E_Tel"
).Range = _
CStr
(.Cells(lZeile, 7).Value)
ActiveDocument.Bookmarks(
"TM_E_Fax"
).Range = _
CStr
(.Cells(lZeile, 8).Value)
ActiveDocument.Bookmarks(
"TM_E_Mail"
).Range = _
CStr
(.Cells(lZeile, 9).Value)
ActiveDocument.Bookmarks(
"TM_E_KD"
).Range = _
CStr
(.Cells(lZeile, 10).Value)
Exit
Do
End
If
lZeile = lZeile + 1
Loop
End
With