Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

nochmal Outlook: Objekt als Prozedurparameter, geht das nicht?

Empfohlene Antworten

Veröffentlicht

Moin, moin!

Auch dies hier dünkt mich seltsam...

Ich kann mir Informationen zu den Elementen eines Aufgabenordners anzeigen lassen mit:

    

    Dim myOlApp As Outlook.Application

    Dim myNamespace As Outlook.NameSpace

    Dim myTaskPath As String

    Dim myTaskFolder As Outlook.MAPIFolder

    Dim myTasks As Outlook.Items

    Dim myTask As Outlook.TaskItem



Sub MAIN()

    myTaskPath = "foopath"

    myContactPath = "barpath"


    Set myOlApp = CreateObject("Outlook.Application")

    Set myNamespace = myOlApp.GetNamespace("MAPI")


'GetFolder hier der Übersichtlichkeit halber weggelassen, funktioniert aber...

    Set myTaskFolder = GetFolder(myTaskPath)

    Set myTasks = myTaskFolder.Items


    For Each myTask In myTasks

        If (myTask.Class = olTask) Then

           MsgBox "Kontakt zu diesem Task ist " & myTask.ContactNames

        End If

     Next


End Sub

Das funktioniert soweit. Nun möchte ich aber mit diesen TaskItems mehr anstellen und sie daher einer weiteren Subroutine übergeben, indem ich die o.g. MsgBox-Zeile ersetze durch den Aufruf

        listFields (myTask)

und an anderer Stelle die zugehörige Subroutine wie folgt erstelle:

Sub listFields(myTask As Outlook.TaskItem)


        MsgBox "Kontakt zu diesem Task ist " & myTask.ContactNames


End Sub

Nun klappt's aber nicht mehr und ich erhalte beim Einsprung in listFields() die Fehlermeldung "Objekt erforderlich!". Ich war der Ansicht, der Subroutine mit myTask eben jenes erforderliche Objekt übergeben zu haben? Weiß jemand Rat?

probier es mit:

"call listFields (myTask)"

oder

"listFields myTask"

Jau, klappt beides, herzlichen Dank.

Das kommt davon, wenn man zum Einlesen nur ein Buch aus der Dummie-Reihe in der Bibliothek gefunden hat... :rolleyes:

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.