verwendete Version 2.0.12.
Wenn ich einem Artikel z. B. einen VBA-Code in folgender Form hinzufüge...
Code: Select all
Sub ExportCategories()
Dim sFilePath As String
Dim iFileNumber As Integer
Dim oNameSpace As NameSpace
Dim oCategory As Category
Dim sCatName As String
Dim lCatColor As Long
Dim lCatShortcut As Long
On Error GoTo ExportCat_Error
Set oNameSpace = _
Application.GetNamespace("MAPI")
If oNameSpace.Categories.Count > 0 Then
sFilePath = "C:\Outlook\Kategorien.txt"
iFileNumber = FreeFile
Open sFilePath For Output As #iFileNumber
For Each oCategory In oNameSpace.Categories
With oCategory
sCatName = .Name
lCatColor = .Color
lCatShortcut = .ShortcutKey
End With
Write #iFileNumber, _
sCatName, lCatColor, lCatShortcut
Next oCategory
MsgBox _
Prompt:="Export abgeschlossen!", _
Title:="Kategorieexport"
Else
MsgBox _
Prompt:="Makro beendet!" & vbCr & _
"Keine Kategorien vorhanden...", _
Title:="Kategorieexport"
End If
Code: Select all
Sub ExportCategories()
Dim sFilePath As String
Dim iFileNumber As Integer
Dim oNameSpace As NameSpace
Dim oCategory As Category
Dim sCatName As String
Dim lCatColor As Long
Dim lCatShortcut As Long
On Error GoTo ExportCat_Error
Set oNameSpace = _
Application.GetNamespace("MAPI")
If oNameSpace.Categories.Count > 0 Then
sFilePath = "C:\Outlook\Kategorien.txt"
iFileNumber = FreeFile
Open sFilePath For Output As #iFileNumber
For Each oCategory In oNameSpace.Categories
With oCategory
sCatName = .Name
lCatColor = .Color
lCatShortcut = .ShortcutKey
End With
Write #iFileNumber, _
sCatName, lCatColor, lCatShortcut
Next oCategory
MsgBox _
Prompt:="Export abgeschlossen!", _
Title:="Kategorieexport"
Else
MsgBox _
Prompt:="Makro beendet!" & vbCr & _
"Keine Kategorien vorhanden...", _
Title:="Kategorieexport"
End If