Hiermit solltest du weiterkommen. ( und hier ist mein
WunschzettelSub Click(Source As Button)
Dim s As New NotesSession
Dim db As notesdatabase
Dim v As NotesView
Dim grpdoc As notesdocument
Dim persondoc As NotesDocument
Dim col As NotesDocumentCollection
Dim Application As Variant
Dim Book As Variant
Dim Sheet As Variant
Dim n As Integer
Dim i As Integer
Set Book=Nothing
Set Sheet = Nothing
Set Application=Nothing
Set Application = CreateObject("Excel.Application")
Set Book = Application.Workbooks.Add
If Application.Workbooks(1).Worksheets.Count=0 Then
Set sheet = Application.Workbooks(1).Worksheets.Add
End If
Set Sheet = Application.Workbooks(1).Worksheets(1)
Sheet.Name = "Export Adressen" 'Name der Arbeitsmappe
Book.Application.Visible=True
Set db = s.CurrentDatabase
Set v = db.GetView("($VIMPeople)")
Set col = db.UnprocessedDocuments
Set grpdoc = col.GetFirstDocument()
n=0
i = 0
While Not(grpdoc Is Nothing)
Forall members In grpdoc.members
Dim NameText As New NotesName(grpdoc.Members(n))
n=n+1
Set persondoc = v.GetDocumentByKey(NameText.Abbreviated)
If persondoc Is Nothing Then
Msgbox "nicht gefunden"
Else
Sheet.Range("A" & i+1).Value = personDoc.Title(0)
Sheet.Range("B" & i+1).Value = personDoc.FirstName(0)
Sheet.Range("C" & i+1).Value = personDoc.LastName(0)
Sheet.Range("D" & i+1).Value = personDoc.JobTitle(0)
Sheet.Range("E" & i+1).Value = personDoc.CompanyName(0)
Sheet.Range("F" & i+1).Value = personDoc.OfficeStreetAddress(0)
Sheet.Range("G" & i+1).Value = personDoc.OfficeZip(0)
Sheet.Range("H" & i+1).Value = personDoc.OfficeCity(0)
Sheet.Range("I" & i+1).Value = personDoc.OfficeCountry(0)
i=i+1
' Msgbox "gefunden"
End If
End Forall
Set grpdoc = col.GetNextDocument(grpdoc)
Wend
End Sub