ich hab ein kleines Problem bei dem ich nicht mehr weiter komme und auch nichts gefunden habe:
Gibt es eine Möglichkeit die Notizfelder aus Outlook Per VBA anzusprechen und nach Excel zu übertragen.
Gruß Kisselstein
Hallo,
Hier ein BeispielCode (Verweis "Outlook xx Object Library" aktivieren):
Option Explicit
Sub olNotes()
Dim ol As Object, oINotes As MAPIFolder, oNote As NoteItem, i%
Set ol = CreateObject("Outlook.Application")
Set oINotes = ol.GetNamespace("MAPI").GetDefaultFolder(olFolderNotes)
i = Range("A" & Rows.Count).End(xlUp).Row + 1
For Each oNote In oINotes.Items
Cells(i, 1).RowHeight = 94.5
Cells(i, 1) = oNote.LastModificationTime
Cells(i, 2) = oNote.Body
oNote.Close olSave
i = i + 1
Next
Set ol = Nothing
End Sub
Es gibt aber eine Einschränkung durch
eine Outlook - Sicherheitswarnung:
"Ein Programm versucht, auf Ihre in Outlook
gespeicherten E-Mail-Adressen zuzugreifen..."
Es lässt sich aber umgehen S. hier:
http://www.contextmagic.com/express-clickyes/
Viel eleganter wäre es wenn man die Notizen
von Outlook nach Excel exportiert.
Dazu der BeispielCode (in einem Modul im Outlook-VBA-Fenster kopieren):
Option Explicit
Sub olNotes()
Dim oINotes As MAPIFolder, oNote As NoteItem, i%, xl As Object, ws As Object
Set oINotes = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderNotes)
Set xl = CreateObject("Excel.Application")
Set ws = xl.Workbooks.Open("C:\test\Mappe.xls")
xl.WindowState = 2
xl.Visible = True
i = 1
For Each oNote In oINotes.Items
With ws.Sheets(1)
.Cells(i, 1) = oNote.Body
.Cells(i, 2).Offset(, 1) = oNote.LastModificationTime
'.Columns.autofit
End With
i = i + 1
Next
End Sub
Gruss
Tassos