Blizzardo1 icon

For DarkAlien

Blizzardo1 | PRO | 07/20/11 07:20:29 AM UTC | 0 ⭐ | 535 👁️ | Never ⏰ | []
VB.NET |

900 B

|

None

|

0 👍

/

0 👎

Sub SlaMailOp()
 
  Dim Item As Object
  Dim Map As String
  Dim BestandsNaam As String
  Dim Mail As Outlook.MailItem
  
  Set Item = Application.Explorers(1).Selection(1)
  If TypeName(Item) <> "MailItem" Then
    MsgBox "Selecteer eerst een mailbericht...", vbInformation, "Opdracht niet mogelijk"
    Exit Sub
  End If
  
  Map = "c:\Mails"
  If CreateObject("Scripting.FileSystemObject").FolderExists(Map) Then
    If Right(Map, 1) <> "\" Then
      Map = Map + "\"
    End If
    Set Mail = Item
    BestandsNaam = Replace(Mail.Subject, ":", "")
    BestandsNaam = Replace(BestandsNaam, "/", "")
    BestandsNaam = Replace(BestandsNaam, "\", "")
    BestandsNaam = Replace(BestandsNaam, "<", "")
    BestandsNaam = Replace(BestandsNaam, ">", "")
    BestandsNaam = Replace(BestandsNaam, ";", "")
    Mail.Categories = "VKG"
    Mail.SaveAs Map & BestandsNaam & ".msg", olMSG
  End If
 
End Sub

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎