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.

Outlook VBA Nachrichtenobjekte

Empfohlene Antworten

Veröffentlicht

Hallo!

Ich habe mit dem untenstehenden Code, der HTML-Mails automatisch in TXT wandeln soll, aber auch eine Kopie der Originalmail in den Unter-Ordner HTML verschieben soll. Das Umwandeln funktioniert, aber das Kopieren (ist auskommentiert) nicht, es werden lediglich leere Mails abgelegt. Was habe ich falsch gemacht?

Sub HTML2Txt()

'wandelt htlmails in Text um

   Dim objNameSpace As NameSpace

    Dim objPosteingang As MAPIFolder

    Dim objNachricht As MailItem


    Set objNameSpace = Application.GetNamespace("MAPI")

    Set objPosteingang = objNameSpace.GetDefaultFolder(olFolderInbox)

    For Each objNachricht In objPosteingang.Items

        If objNachricht.UnRead = True And objNachricht.GetInspector.EditorType _

        = olEditorHTML Then

            Dim oSubFolder As Outlook.MAPIFolder

            Dim objKopie As MailItem

'            Set objKopie = Application.CreateItem(olMailItem)  ' geht noch

'           Set oSubFolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Folders("HTML") ' geht auch

'            objKopie = objNachricht.Copy

'            objKopie.Move oSubFolder  'kopiert leere Nachricht warum?

            Set oSubFolder = Nothing

            objNachricht.Body = objNachricht.Body                   'löscht HTML -> TXT

            objNachricht.Save                                       'wieder speichern

        End If

    Next

'    ActiveExplorer.ShowPane olPreview, True                        'Voransicht für Nachrichten einschalten

End Sub

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.