Advertisement
Blizzardo1

For DarkAlien

Jul 20th, 2011
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.90 KB | None | 0 0
  1. Sub SlaMailOp()
  2.  
  3.   Dim Item As Object
  4.   Dim Map As String
  5.   Dim BestandsNaam As String
  6.   Dim Mail As Outlook.MailItem
  7.  
  8.   Set Item = Application.Explorers(1).Selection(1)
  9.   If TypeName(Item) <> "MailItem" Then
  10.     MsgBox "Selecteer eerst een mailbericht...", vbInformation, "Opdracht niet mogelijk"
  11.     Exit Sub
  12.   End If
  13.  
  14.   Map = "c:\Mails"
  15.   If CreateObject("Scripting.FileSystemObject").FolderExists(Map) Then
  16.     If Right(Map, 1) <> "\" Then
  17.       Map = Map + "\"
  18.     End If
  19.     Set Mail = Item
  20.     BestandsNaam = Replace(Mail.Subject, ":", "")
  21.     BestandsNaam = Replace(BestandsNaam, "/", "")
  22.     BestandsNaam = Replace(BestandsNaam, "\", "")
  23.     BestandsNaam = Replace(BestandsNaam, "<", "")
  24.     BestandsNaam = Replace(BestandsNaam, ">", "")
  25.     BestandsNaam = Replace(BestandsNaam, ";", "")
  26.     Mail.Categories = "VKG"
  27.     Mail.SaveAs Map & BestandsNaam & ".msg", olMSG
  28.   End If
  29.  
  30. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement