-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUIExtension.bas
105 lines (92 loc) · 3.8 KB
/
UIExtension.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Attribute VB_Name = "UIExtension"
'--------------------------------------------------
' Zeige den Kategorie-Auswahl-Dialog an
' (Verwende diese Funktion, wenn eine Mail im separaten Fenster angezeigt wird)
'--------------------------------------------------
Public Sub ShowCatDialog()
Dim mail As MailItem
Set mail = Application.ActiveInspector.CurrentItem
mail.ShowCategoriesDialog
End Sub
'--------------------------------------------------
' Zeige den Kategorie-Auswahl-Dialog an
' (Verwende diese Funktion, wenn eine oder mehrere Mails in einem Ordner selektiert sind
' und/oder im Lesebereich angezeigt werden)
'--------------------------------------------------
Public Sub ShowCatDialog2()
Dim mail As MailItem
Dim count As Integer
Dim cats As String
count = 0
For Each mail In Application.ActiveExplorer.selection
If count = 0 Then
mail.ShowCategoriesDialog
cats = mail.Categories
Else
mail.Categories = cats
mail.Save
End If
count = count + 1
Next mail
End Sub
'--------------------------------------------------
' Zeige den Kategorie-Auswahl-Dialog an
' (Verwende diese Funktion, wenn eine oder mehrere Mails in einem Ordner selektiert sind
' und/oder im Lesebereich angezeigt werden)
'--------------------------------------------------
Public Sub CategorizeConversations()
Dim item
Dim cats As String
Dim conv As Conversation
Dim convMail As MailItem
Dim convMeeting As MeetingItem
For Each item In Application.ActiveExplorer.selection
Set conv = item.GetConversation
If Not IsNull(conv) Then
' get categories
cats = GetCategories(conv)
Debug.Print "setting categories to: "; cats
' apply categories
Call SetCategories(cats, conv)
End If
Next item
End Sub
'--------------------------------------------------
' Verschlüsselung entfernen
' (Verwende diese Funktion, wenn eine oder mehrere Mails in einem Ordner selektiert sind
' und/oder im Lesebereich angezeigt werden)
'--------------------------------------------------
Public Sub RemoveEncryption()
If MsgBox("Verschlüsselung wirklich von allen ausgewählten Mails entfernen?", vbYesNo) = vbYes Then
Const PR_SECURITY_FLAGS = "http://schemas.microsoft.com/mapi/proptag/0x6E010003"
Dim mail As MailItem
For Each mail In Application.ActiveExplorer.selection
mail.PropertyAccessor.SetProperty PR_SECURITY_FLAGS, 0
mail.Save
Next mail
End If
End Sub
'--------------------------------------------------
' Konvertiere einen nicht-ganztägigen Termin in einen ganztägigen Termin
' (Die Funktion ist erforderlich, wenn man Termine ändern möchte, bei denen man eingeladen
' wurde, weil die Funktion dann nicht per UI verfügbar ist.)
'--------------------------------------------------
Public Sub ConvertAppointmentAllDay()
Dim appointment As AppointmentItem
For Each appointment In Application.ActiveExplorer.selection
appointment.AllDayEvent = True
appointment.Save
Next appointment
End Sub
'--------------------------------------------------
' Konvertiere einen ganztägigen Termin in einen nicht-ganztägigen Termin
' (Die Funktion ist erforderlich, wenn man Termine ändern möchte, bei denen man eingeladen
' wurde, weil die Funktion dann nicht per UI verfügbar ist.)
'--------------------------------------------------
Public Sub ConvertAppointmentNotAllDay()
Dim appointment As AppointmentItem
For Each appointment In Application.ActiveExplorer.selection
appointment.AllDayEvent = False
appointment.Save
Next appointment
End Sub