Thema Datum  Von Nutzer Rating
Antwort
Rot Fehler colitems
07.03.2017 11:07:13 Martin
NotSolved
07.03.2017 12:58:21 Onur
NotSolved
07.03.2017 13:11:44 Martin
NotSolved
07.03.2017 13:28:28 Onur
NotSolved
07.03.2017 13:36:50 Onur
NotSolved
07.03.2017 13:49:31 Martin
NotSolved
08.03.2017 17:51:33 Gast98076
NotSolved

Ansicht des Beitrags:
Von:
Martin
Datum:
07.03.2017 11:07:13
Views:
1105
Rating: Antwort:
  Ja
Thema:
Fehler colitems

Hallo,

bei folgendem Code kommt nach Eingabe der EMail-Adresse der Fehler

Laufzeitfehler '-2147352567 (80020009':

Die EmaillAddress, Emai[2Address, EmaiBAddress-Eigenschaft ist
unbekannt.

 

Hat jemand eine Idee - danke

Sub FindEmailAddressInContacts()
  Dim objApp As Application
  Dim objNS As NameSpace
  Dim objContacts As MAPIFolder
  Dim colItems As Items
  Dim objItem As Object
  Dim strAddress As String
  Dim strWhere As String
  Dim blnFound As Boolean

  ' get folder to search
  Set objApp = CreateObject("Outlook.Application")
  Set objNS = objApp.GetNamespace("MAPI")
  Set objContacts = objNS.GetDefaultFolder(olFolderContacts)
  strWhere = "[Email1Address] <> vbNullString " & _
             "Or [Email2Address] <> vbNullString " & _
             "Or [Email3Address] <> vbNullString "
  Set colItems = objContacts.Items.Restrict(strWhere)

  ' get address to search for
  strAddress = InputBox("Find an Address in Contacts")
  If strAddress <> "" Then
    colItems.SetColumns ("Email1Address, Email2Address, Email3Address")
    For Each objItem In colItems
      ' must test for item type to avoid distribution lists
      If TypeName(objItem) = "ContactItem" Then
        If InStr(objItem.Email1Address, strAddress) > 0 Then
          objItem.Display
          blnFound = True
          Exit For
        ElseIf InStr(objItem.Email2Address, strAddress) > 0 Then
          objItem.Display
          blnFound = True
          Exit For
        ElseIf InStr(objItem.Email3Address, strAddress) > 0 Then
          objItem.Display
          blnFound = True
          Exit For
        End If
      End If
    Next
  End If

 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
Rot Fehler colitems
07.03.2017 11:07:13 Martin
NotSolved
07.03.2017 12:58:21 Onur
NotSolved
07.03.2017 13:11:44 Martin
NotSolved
07.03.2017 13:28:28 Onur
NotSolved
07.03.2017 13:36:50 Onur
NotSolved
07.03.2017 13:49:31 Martin
NotSolved
08.03.2017 17:51:33 Gast98076
NotSolved