sábado, marzo 10, 2012

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 isimportant 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 Sub

 

NotesToText 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 Sub

[de http://emperorcrusher.hubpages.com/hub/Export-Outlook-Notes-to-Document-Files]

Ejecutar una macro cuando se abre Outlook

An Outlook Visual Basic for Applications (VBA) macro can use this event procedure to initialize itself when Outlook starts.

Example
This Microsoft Outlook Visual Basic for Applications example displays a welcome message to the user and maximizes the Outlook explorer window when Outlook starts.
Private Sub Application_Startup()
    MsgBox "Welcome, " & Application.GetNamespace("MAPI").CurrentUser
    Application.ActiveExplorer.WindowState = olMaximized
End Sub

1. Launch Outlook.
2. Set your security to Medium or Low (sounds like you did.)
3. Press Alt + F11 on your keyboard
4. If you do not see a module when the Visual Basic editor launches:
    *Expand the folder labeled Microsoft Outlook Objects in the Project Explorer Window.
    *Double click ThisOutlookSession
5. If the module is blank:
    *click the Object dropdown at the top of the module window (it reads General)
    *Select Application
    *Select Startup from the Procedure dropdown (it reads Item Send)
You should now have a code window like this:

CODE

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
End Sub
_____________________________________________________________________
Private Sub Application_Startup()
End Sub

Write your code in the Application_Startup() routine.

[de http://www.tek-tips.com/viewthread.cfm?qid=1276053]