Wie übergebe ich einen gefundenen Wert innerhalb einer Schleife an eine weitere Abfrage

  • Ich möchte im ersten Schritt das Adressbuch Eintrag für Eintrag auslesen und im 2 ten aus einen ausgelesenen Wert den Datenbank catalog durchsuchen
    Das auslesen und der Excel Export vom Adressbuch alleine klappt.
    Aber wie übergebe ich einen gefundenen Wert innerhalb einer Schleife an eine weitere Abfrage.
    Meine Idee war folgende


    Set docSNA = viewSNA.GetFirstDocument
    Do While Not (docSNA Is Nothing)
    xl.activesheet.cells(cc,1).value= docSNA.FirstName(0)+" "+docSNA.LastName(0)
    xl.activesheet.cells(cc,2).value= docSNA.FirstName(0)
    xl.activesheet.cells(cc,3).value= docSNA.LastName(0)
    xl.activesheet.cells(cc,4).value= docSNA.FullName(0)
    xl.activesheet.cells(cc,5).value= docSNA.MailServer(0)
    xl.activesheet.cells(cc,6).value= docSNA.MailFile(0)
    xl.activesheet.cells(cc,7).value=docSNA.GetItemValue("ClntBld")
    xl.activesheet.cells(cc,8).value=docSNA.ShortName(0)

    Dim wert As Variant
    Set wert = MailFile

    Set docCAT = viewCAT.GetDocumentByKey(wert, True)

    xl.activesheet.cells(cc,9).value= docCAT.DbInheritTemplateName(0)
    xl.activesheet.cells(cc,10).value= docCAT.DbSize(0)

    cc=cc+1
    Set docSNA= viewSNA.Getnextdocument(docSNA)
    Loop


    Funzt aber net.


    Hat jemand eine Idee warum.

  • genau das ist der aus dem adressbuch ausgelesene dateipfad.
    Dieser wird in der Exceltabelle richtig reingeschrieben und den wollte ich als Suchkriterium im Catalog gleich weiternutzen.

  • Hi,


    Und wenn wir schon dabei sind.


    Ich schaetze mal, dass "MailFile" ein Feld im Dokument ist.
    Dann ergibt sich also Folgendes:


    Wert = docSNA.MailFile(0) oder
    Wert = docSNA.GetItemValue("MailFile")(0)


    Im ersten Stueck Code war es doch schon richtig. ;)


    Andreas

  • An alle die die es wissen möchten habs jefunden


    Set docSNA = viewSNA.GetFirstDocument
    Do While Not (docSNA Is Nothing)
    xl.activesheet.cells(cc,1).value= docSNA.FirstName(0)+" "+docSNA.LastName(0)
    xl.activesheet.cells(cc,2).value= docSNA.FirstName(0)
    xl.activesheet.cells(cc,3).value= docSNA.LastName(0)
    xl.activesheet.cells(cc,4).value= docSNA.FullName(0)
    xl.activesheet.cells(cc,5).value= docSNA.MailServer(0)
    xl.activesheet.cells(cc,6).value= docSNA.MailFile(0)
    xl.activesheet.cells(cc,7).value=docSNA.ClntBld(0)
    xl.activesheet.cells(cc,8).value=docSNA.ShortName(0)

    Set docCAT = viewCAT.GetDocumentByKey(xl.activesheet.cells(cc,1).value)

    If Not( docCAT Is Nothing) Then
    xl.activesheet.cells(cc,9).value= docCAT.DbInheritTemplateName(0)
    xl.activesheet.cells(cc,10).value= docCAT.DbSize(0)
    Else
    xl.activesheet.cells(cc,9).value= f
    xl.activesheet.cells(cc,10).value= ff
    End If

    cc=cc+1
    Set docSNA= viewSNA.Getnextdocument(docSNA)
    Loop


    Manchmal ist mann soo blind.


    Danke noch mal.