Outlook 2003: Export of notes to text files

L

Lamy

---Background---
I synced my mobile phone with Activesync on two computers.
Unfortunately is Activesync quite buggy since beginning. Instead of
synchronizing my notes it duplicated them with inconsistent content.
It resulted in many notes I have to compare and merge manually.

My plan was to save all Notes out of Outlook 2003 to text files. This
cannot be done by exporting, but by clicking 'Save As' after opening
every single note. Because of the duplicates the number of notes
increased a lot, so I plan to write VB-Script.

---Task---
Export all Notes in Outlook 2003 to text files.

---Problem---
The first note is saved successfully, but for the second note (i=2) I
get a runtime error 13, Type mismatch, in line marked with (***). I do
not see my failure. Can you help?

---Code---
Dim a As Application
Dim mynote As NoteItem
Dim ns As NameSpace
Dim fol As MAPIFolder
Dim i As Integer

Set a = Application
Set ns = a.GetNamespace("MAPI")
Set fol = ns.GetDefaultFolder(olFolderNotes)

For i = 1 To fol.Items.Count
Set mynote = fol.Items(i) '(***)
mynote.SaveAs "c:\temp\Notes\" & mynote.Subject & ".txt", olTXT
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top