Mail über Regel mit Script automatisch speichern

Home-›Foren-›Outlook-›Outlook VBA-›Mail über Regel mit Script automatisch speichern

1 Antwort anzeigen (von insgesamt 1)
  • Autor
    Beitrag
  • #184905
    Unbekannt
    Participant

      Hi,

      in den Regeln wird es nur angezeigt, wenn du dem Sub ein Argument des Typs Outlook.MailItem mitgibst.
      Ich hab das mal umgeschrieben, da es nicht der einzige Fehler war 😉

      Public Sub SaveAsTXT(myItem As Outlook.MailItem)
      strname = myItem.Subject
      strname = Replace(strname, \”/\”, \” \”)
      strname = Replace(strname, \”\\\”, \” \”)
      strname = Replace(strname, \”:\”, \” \”)
      strname = Replace(strname, \”?\”, \” \”)
      strname = Replace(strname, Chr(34), \” \”)
      strname = Replace(strname, \”<\", \" \") strname = Replace(strname, \">\”, \” \”)
      strname = Replace(strname, \”|\”, \” \”)
      \’Prompt the user for confirmation
      Dim strPrompt As String
      strPrompt = \”Are you sure you want to save the item? If a file with the same name already exists, it will be overwritten with this copy of the file.\”
      If MsgBox(strPrompt, vbYesNo) = vbYes Then
      myItem.SaveAs \”C:\\Technik\” & strname & \”.msg\”, Outlook.OlSaveAsType.olMSG
      Else
      MsgBox \”There is no current active inspector.\”
      End If
      End Sub

      Gruß

    1 Antwort anzeigen (von insgesamt 1)

    Hat Ihnen der Beitrag gefallen?

    1 Stern2 Sterne3 Sterne4 Sterne5 Sterne (Keine Bewertung vorhanden)
    Loading...