Export Outlook Notes to Document or Text Files
Export Outlook Notes to Document Files
There are a lot of people who want a free way to export their Outlook notes to separate document files. Here is a step by step method of exporting those notes. It may seem tricky, but it really is simple and should take all of 5 minutes to complete. The actual export happens so quickly you will be astonished. The notes will be exported into Word or text documents with the same name as the notes.
Please understand that Windows does not allow many special characters in file names, so you will need to manually remove any special characters like <.>:"/\|?* from your note name before the conversion. The following device names are also restricted from use as file names by Windows and should not be the name of a note: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. To help you out, the code I provided will automatically replace any "/" or "\" characters with a "-". The rest is up to you to rename manually or you may alter the code to convert even more restricted characters or names.
- Create a folder on the root (main part) your C: drive named "Notes". It is important that this folder be on the root of the C: drive.
- Open Outlook.
- After Outlook opens, click on the top bar of the Outlook window next to the name Microsoft Outlook.
- Press ALT-F11 which will open Outlook's Visual Basic window. If it does not open, be sure you clicked on the top bar of the Outlook window and press ALT-F11 again.
- On the top toolbar, click on Insert and Module. You should see a new window pane open labeled Project1, Module1.
- Copy the code you find listed below in this article and paste it in the Module1 window pane. If you wish to export to a document that can be opened in Word (rich text format), use the NotesToRTF code. If you wish to export to text files, use the NotesToText code.
- On the top toolbar, click on Run and then click on "Run Sub/Userform".
- A window will pop up asking you to select the folder where your notes are located. For most people, this will simply be your normal Notes folder. Select the Notes folder and then select OK. [More advanced users may select different note folders they may have created, following these steps over and over until all their notes are exported.]
- The Notes will quickly be exported at this point. "Running" will appear next to "Microsoft Visual Basic" window name at the top of the screen and disappear when the notes are exported. You may see it flash for a second if you have just a few notes. For hundreds or thousands of notes, it will take longer. Wait for "Running" to go away and you may proceed.
- Close the Microsoft Visual Basic window.
- Close Outlook. You will receive a popup window asking if you want to save the VBA project. Answer No.
- Look in the Notes folder on the C: drive to find your notes.
If you received a "Run time error", click End and then check the following:
- Did you use a restricted character or name in a note?
- Did you REALLY name the folder Notes in the ROOT of the C: drive?
- Fix the folder name and then go back to the Microsoft Visual Basic window and click on Run and then "Run Sub/Userform" again.
- The code is proven and should work every time when you follow the directions. If it still fails, I suspect you may have a corrupted Outlook data file. There are many Hub pages that address how to fix the problem. Simply search for "scanpst" and follow he directions listed in the page.
NotesToRTF Code
Sub NotesToRTF()
Set myNote = Application.GetNamespace("MAPI").PickFolder
For cnt = 1 To myNote.Items.Count
noteName = Replace(Replace(myNote.Items(cnt).Subject, "/", "-"), "\", "-")
myNote.Items(cnt).SaveAs "c:\notes\" & noteName & ".rtf", OlSaveAsType.olRTF
Next
End SubNotesToText Code
Sub NotesToText()
Set myNote = Application.GetNamespace("MAPI").PickFolder
For cnt = 1 To myNote.Items.Count
noteName = Replace(Replace(myNote.Items(cnt).Subject, "/", "-"), "\", "-")
myNote.Items(cnt).SaveAs "c:\notes\" & noteName & ".txt", OlSaveAsType.olTXT
Next
End SubComments
Beautiful! Thanks very much - it worked perfectly.
This is exactly what I was looking for. Only problem was with notes that had a blank space at the end of the first line. All I needed to do was remove the space. Thanks
This Guy Rocks! Hat down...
Now - if you can figure how to export them into MAC Notes or MAC Stickies - you will be the KING !!!!!
Thanks so much. This has been on my todo list for YEARS!
I still get run-time error although I've certainly checked the naming of the folder and location... :(
@Isaac, sorry you are having problems. It has worked wonderfully for so many. Perhaps your Outlook data file is corrupted. Please look up "scanpst" in the Hubpages. The repair procedures may fix some issues. Then rerun the code snippit.
I finally got around to cleaning useful files out of an old computer and this method saved me tons of hours. This was also on my To Do list for years. Now my wife will stop nagging me. Emporer Crusher, you are da' bomb!!!!!
Needed to mod it a bit myself:
Replace(Replace(Replace(myNote.Items(cnt).Subject, "/", "-"), "\", "-"), ":", "-")
it's great - thanks from Europe as well
Thank you, that is extremely helpful. Quick and easy.
Thanks mate. Works like a treat. You saved a lot my time.
Cheers.
If I export my Outlook 2003 Notes to a Word or Text file, does that change anything in the original file? I want the original Outlook Notes to remain the same. I want to use the new exported Notes file to see how it looks after exporting. Before I use your procedure I want to be sure I don't ruin my original files and setup. Your help would be very appreciated! Thank you!
@meema, good question! Your Outlook Notes will always remain the same. This simply exports your notes to files. Remember, when you export them, changes in Outlook notes will not be reflected in the exported notes and vice versa. But you can always export them again which would overwrite any files you still have in the Notes folder on the root of the C: drive. To be clear, that means the old files will be lost and overwritten with what is currently in the Outlook notes. Thanks for asking! If you like this hub, please vote me up! Thanks!
I've tried and it exported 1 note then stopped/failed with
Run-time error '-2147467259 (80004005)':
The operation failed.
When I changed the code
For cnt = 1 To myNote.Items.Count
to
For cnt = 2 To myNote.Items.Count
It exported the next note but then exported 1 note then stopped again with the same error. If I repeat changing the above code "cnt = x", it continues exporting 1 note and stops.
Looks like the problem is not looping. If there were syntax error, it would not export at all, right.
Wonderful! Does it handle notes with the same name? Could that be why its crashing? Perhaps add an "if exist" loop with a counter?
Thank you, it worked perfectly
Thank you! It's a life saver.
I got an error, but then I checked the "Notes" folder I created and it seems to have worked! Easy! -and i'm not very 'geeky' at all. thx!
This was great! Thank you. Helpful hint for others: I got an "run time error" every time it tried to export a note with a ":" in the title. I needed to remove those from each note and then it exported just fine.
@Rookie1, you are the second person who commented that you had a problem with a colon in your note name. I've edited the Hub post to detail which characters cannot be used in file names. Further, I listed some special names that cannot be used as note names, because they either cause problems or are forbidden as file names in Windows.
@Raymond, I suspect you have a corrupted Outlook data file. I've added a suggestion in the Hub to address this issue.
This worked beautifully. Thanks so much for the clear, concise instructions. I DID have trouble getting the Visual Basic Editor to come up, but when I had my cursor over the middle of the screen and pressed ALT F4, it finally worked. Thanks again.
I had colons (:) in the first line of the notes, and that created problem.. Once I fixed the notes. I'm stuck with the error that is mentioned by @Raymond. I tried changing the count from 1 to 2, but still no go. any other thoughts? I have about 700 notes :-)
@Tejas, I suggest you do the same thing I suggested for Raymond. And anyone else with the same problem, I also suggest this for you (IE. please try this before posting a comment of a failure). It may be a corrupted data file. From my hub: "There are many Hub pages that address how to fix the problem. Simply search for "scanpst" and follow he directions listed in the page." Let's see if that fixes your problem.
Hi & thanks for your great instructions. When trying to perform the 'run' I received the error message:
"The Macros on this project are disabled. Please refer to the online help or documentation of the host application to determine how to enable macros." How do I rectify that so I can do the export please? Thanks, Nick
@Nick, I just did a Google search of your error message and came up with a lot of results on how to enable macros, especially from Microsoft. I suggest you follow some of these directions that are specific to the version of Office that you are using.
Thanks but now I get a Compile Error :(
@Nick,I'm sorry for your troubles. It seems you have some problems that are outside the scope of this hub. Since this is just a comment section, at this time it might be best to hire a technician or find a forum to post your problem and work through a solution.
Good work!
Before the line myNotes.Items... I insertet these lines:
noteName = Replace(noteName, ":", "-")
noteName = Replace(noteName, "?", "-")
noteName = Replace(noteName, "*", "-")
noteName = Replace(noteName, Chr(34), "-")
This makes, that unallowed characters in the filename are translated into "-".
I have one note that is greater than 30,000 characters (30,168 bytes) and it would not open in Outlook. But the NOTE did open and it did SAVE as TEXT file with the VB6 script!
Also, I had error ...
-2147467259 (80004005) is invalid character error.
which is same error as previous user reported.
So, I added ...
notename = Replace(notename, Chr(9), "-")
to removed the invisible TAB Character from Subject.
Error was eliminated.
Thank you so much!! I've been looking for a way of doing this for literally years. I've finally managed to abandon the tyranny and time wasting of Outlook and Outlook exchange!!!! If anyone wants to export all their e-mails, the best I have found of doing it is to set up your Gmail in Outlook and then copy and paste all your folders from your Exchange account to your Gmail account. It is time consuming but it all gets there with correct dates etc.
Thanks, This worked perfectly. This has been on my to do list for a while.
Marco - it was getting through only about 33 of my 200 total, then started failing for m. UNTIL I made your additions - THANK YOU! You should change your name from Marco to Macro :)
You ROCK THE HOUSE!! This is the best thing that ever happened to me!
Thank you so much for helping this ignorant slob! It worked like a charm. I have no idea how or why but it worked great!
Thanks a lot . It worked fantastic ¡
Champion man ¡
I love everything about this!
I'm getting a compile error at Set myNote expected end of statement?
lzhang 20 months ago
Fantastic!!! You're the best.