Vbscript for Outlook emails backup and cleanup

The vbscript will save the outlook email into the local folder as a backup and delete the email from the mailbox. Which runs in background and gives live update on HTA application. Emails are backed up into folder.Deletes and free up the mailbox. Can exclude folder(s)

 
 
 
 
 
4.7 Star
(3)
2,116 times
Add to favorites
Office
2/14/2014
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Don't want emails to be deleted
    1 Posts | Last post April 28, 2017
    • Hi,
      I love the idea of this scripts and is very useful to me. However, I don't want the emails to be deleted from my outlook.
      
      I would like to do this:
      1) All emails I send - including associated attachments should be automatically saved on the hard drive as "Name"'"Subject"-"date", etc format (msg format so i can re-open them in outlook)
      
      2) All emails I receive - including associate attachments should be automatically saved on the hard drive as "Name"'"Subject"-"date", etc format. (msg format so i can re-open them in outlook)
      
      All this without deleted anything from outlook and if there are any special characters in the email subject line they should be ignored.
      
      I appreciate your support.
      Thank you in advance!
      Sanjiya
      
  • Script runs with no error but no file processed
    1 Posts | Last post October 20, 2015
    • Hi Somesh,
      
      
      Great script.  I must be doing something wrong.  I am facing similar problems.
      
      Script is running fine but its not processing any file to path.
      
      I provided valid email ID, Path as (C:\Users\xxxxx\Desktop\Audit\Mail_Test\Script\Test_Mails\) and 1 days old emails to be archived.
      
      Its processing the script with no error but not archiving mails. Please help.
      
      
      Status of the outlook emails backup and clean-up script
      Email account    : Manoj_Test
      Start time        : 20/10/2015 09:15:54
      Status        : Finished
      End time        : 20/10/2015 09:15:54
      Path        : C:\Users\xxxxx\Desktop\Audit\Mail_Test\Script\Test_Mails\
      Number of days old emails to backup    : 1
      Total Size freed up (Kb)    : 0
      
      
      Folder Name Total emails  Processed Size saved(Kb) Status 
      Inbox  12  0  0  Finish  
      Sent Items  7  0  0  Finish  
      
      Outlook backup and clean-up script has completed, you may now close this window
      
      
      
      Request to reply to "bbmanoj121@rediff.com" as well.
      
      Thanks.
      Manoj B
  • Code: 800A0009 Subscript out of range: '[number: 76]'
    1 Posts | Last post June 26, 2015
    • I am getting the error "Code: 800A0009 Subscript out of range: '[number: 76]"
      The error occurs at Line: 162 Char: 1 "folder(foldcntr-1,0)=objworkingFolder" 
      
      
      I also get a Script Error with the message "Error: Input past end of file" at Line 22 Character 9.
      
  • Script runs with no error but no file processed
    2 Posts | Last post March 28, 2015
    • Hi Somesh,
      
      Great script.  I must be doing something wrong.  I am facing similar problems.
      
      Script is running fine but its not processing any file.
      
      I provided valid email ID, Path as (C:\Test\archive.pst) and 2 days old emails to be archived.
      
      Its processing the script with no error but not archiving mails. Please help.
      
      Request to reply to "ihabzaky@gmail.com" as well.
      
      Regards,
      Zaky
    • Hello Zaky,
      
      This script will not save the emails into .pst file rather it will only save the emails as .msg files in a folder path that you provide.
      So, only provide target folder path when asked.
      
      Regards,
      Somesh
  • Script runs with no error, but there are no files processed
    2 Posts | Last post March 28, 2015
    • Hi Somesh,
      
      Can you help me as script is running fine but its not processing any file.
      
      I provided valid email ID, Path as (C:\Test\archive.pst) and 2 days old emails to be archived.
      
      Its processing the script with no error but not archiving mails. Please help.
      
      Request to reply to "msin230983@yahoo.com" as well.
      
      Regards
      Mandeep
    • Hello Mandeep,
      
      This script will not save the emails into .pst file rather it will only save the emails as .msg files in a folder path that you provide.
      So, only provide target folder path when asked.
      
      Regards,
      Somesh
  • No Files moved
    2 Posts | Last post August 20, 2014
    • Script runs with no error, but there are no files processed
    • Foud a solution:
      within the saveas procedure i added a 	
      
      Wscript.sleep "5"	
  • What if I receive error code: 8004010F
    2 Posts | Last post April 07, 2014
    • Line: 56
      
      Char: 1
      
      Error: The operation failed. An object could not be found.
      
      Code: 8004010F
      
      Source: Microsoft Office Outlook
    • It is actually referring to the store item that is mailbox name.
      You should enter the name as it appears in the outlook.
  • What if i receive error Code: 800A01B6
    1 Posts | Last post February 14, 2014
    • If you receive below error.
      
      Line: 183
      Char: 2
      Error: Object doesn't support the property or method:
      'colitems(...).ReceivedTime'
      Code: 800A01B6
      Source: Microsoft VBSCript runtime error
      
      Solution : Completely close your outlook and rerun the outlook. Wait for outlook to completely load then execute the script.