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.

Empfohlene Antworten

Veröffentlicht

Hallo zusammen, 

wenn man über Excel VBA ein Programm erstellt, das eine automatische E-Mail schreibt, wisst ihr wie man das Format der E-Mail ändern kann? 

Ich bräuchte auch den Hintergrund in Outlook dann schwarz und nicht weiß. 

Hab schon einiges probiert. Komme nicht weiter. 

With myMessage
            .to = email
            '.attachments.Add
            .Subject = "Erste Schritte zu Ihrer Fahrzeugzulassung"
            .bodyformat = 2
            .HTMLbody = "<p style='font-family:corpos;font-size:12'>" & "<b> Mailtext1"
            .display
        End With

das habe ich probiert in allen Variationen, vielleicht findet jemand einen Fehler. Danke

  • Autor

Vielen Dank für die Hilfe! 

vor 1 Stunde schrieb KeeperOfCoffee:

uhm .... einfach den Background im <body> festlegen? Oder was genau meinst du?

uhm...bitte was? Du hast doch das Format schon in deinem MailItem festgelegt.

Ansonsten ist hier die Referenz: https://docs.microsoft.com/de-de/office/vba/api/outlook.mailitem

ja den Background, die Schriftart und die Schriftfarbe festlegen - also sprich in Outlook(im Email-Text) soll ein ausgewähltes Format erscheinen.

ich habe probiert das Format im Mailitem festzulegen, der Text formatiert sich in der E-Mail leide noch nicht. 

Danke für den Link, habe da auch schon alle ausprobiert, hat nicht funktioniert. Es kann sein, dass ich was im Code vergessen habe oder so, bin noch eher neu

hier noch der Code:

 If frau = True Then
        With myMessage
            .to = email
            '.attachments.Add
            .Subject = "Erste Schritte zu Ihrer Fahrzeugzulassung"
            .BodyFormat = olFormatHTML                                              das wird nicht angenommen
            .HTMLbody = "<body bgcolor="#000000">Mailtext1</body>"           und da nimmt er die Rautetaste nicht an und ohne diese passiert nichts 
            .display
        End With

 

 

vor 5 Stunden schrieb Schirin:

und da nimmt er die Rautetaste nicht an und ohne diese passiert nichts

Was heißt er nimmt sie nicht?

olFormatHTML wird auch nicht akzeptiert?

Ansonsten wie folgt probieren:

<body style="background-color: black">

Was hat in deinem Beispiel das .Attachments.add zu suchen?

Bearbeitet von r4phi

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.