We help IT Professionals succeed at work.

Outlook folder Synchronization

krp9711
krp9711 asked
on
I have a customer who has Outlook 98 is set for offline reading of folders.  He has created many folders and subfolders and hates to have to right click on the folders and set them to synchronize offline.  He wants to set Outlook to automatically synchronize new folders created daily to without having to manually set the synch option. Any ideas or settings would be appreciated.
Comment
Watch Question

Commented:
There isn't an option in Outlook that will automatically mark a folder for offline usage when it is created.  I think this was done because OST files do have limits and can corrupt when the file size approaches 2GB.

In any event, the only solution I can see is to write a Windows Script Host (*.VBS) file that marks all folders available for offline usage.  Here is a sample that you can work with.

--- begin mrkoffline.vbs ---
Dim objMAPISession      'MAPI Session
Dim objInbox            'Inbox
Dim objInfostore        'Message store
Dim objRootFolder       'Root Folder

Dim colFields           'Fields Collection
Dim objField            'Field


Dim strStoreID          'StoreID
Dim strResult           'Result holder for calls

Dim strErrProvider      'Message text

Dim CdoPR_OFFLINE_FLAG

strErrProvider = "Your primary delivery location is not your Microsoft Exchange Mailbox!" & CHR(13) & CHR(10)
strErrProvider = strErrProvider & CHR(13) & CHR(10)
strErrProvider = strErrProvider & "Please correct this setting under Tools | Services | Delivery prior to running this script."

CdoPR_OFFLINE_FLAG = &H663D0003

Set objMAPISession = CreateObject("MAPI.Session")

On Error Resume Next
strResult = objMAPISession.Logon

If Err.Number <> 0 Then
  WScript.Echo "Unable to create a MAPI Session."
  Set objMAPISession = Nothing
  WScript.Quit
End If

Err.Clear

Set objInbox = objMAPISession.Inbox

If Err.Number <> 0 Then
  WScript.Echo "Unable to acquire the Inbox."
  WScript.Quit
End If

Err.Clear

strStoreID = objInbox.StoreID
Set objInfoStore = objMAPISession.GetInfoStore(strStoreID)

If objInfostore.ProviderName <> "Microsoft Exchange Server" Then
  WScript.Echo strErrProvider
  Set ObjInfoStore = Nothing
  Set objInbox = Nothing
  objMAPISession.Logoff
  Set objMAPISession = Nothing
  WScript.Quit
End If


Set colFields = objInbox.Fields
Set objField = colFields.Item(CdoPR_OFFLINE_FLAG)

If objField.Value = 0 Then
  Set objField = nothing
  Set colFields = nothing
  Set objInbox = nothing
  Set objInfostore = Nothing
  objMAPISession.Logoff
  Set objMAPISession = Nothing
  Wscript.Echo "Offline Folders have not been enabled for this profile!"
  WScript.Quit
End If

Set objField = nothing
set colFields = nothing
set objInbox = nothing


WScript.Echo "This process can take some time on large mailboxes.  A dialog will be displayed when the operation is complete."

Set objRootFolder = objInfostore.RootFolder

MarkFolderOffline objRootFolder, True


WScript.Echo "The process is complete!"

Set objInfostore = Nothing
Set objInbox = Nothing

objMAPISession.Logoff

Set objMAPISession = Nothing

WScript.Quit


Function MarkFolderOffline ( objTarget, bRootFolder)

  Dim colFields
  Dim objField
  Dim objFolder
  Dim objTempFolder
 
  Set objTempFolder = nothing
  Set colFields = nothing
  Set objField = nothing
  Set objFolder = nothing

  Set objTempFolder = objTarget


  Set colFields = objTempFolder.Fields
  Set objField = colFields.Item(CdoPR_OFFLINE_FLAG)

  If (bRootFolder = False) and (objField.Value = 0) Then

    objField.Value = 1
    objTempFolder.Update

  End If

  For each objFolder in objTempFolder.Folders
    'WScript.Echo objFolder.Name
    MarkFolderOffline objFolder, False
  Next

End Function
Hello everyone.

We are cleaning up this topic area. This question is considered to be *outdated* and we would like you to move on with it.

Toward that end, we graciously request the following:

-----Askers-----

*Do NOT award points to me.

*Stay active in your question. If you asked this question and have not yet responded to the comments given by experts, please do so as soon as possible, even if it is just to say "I haven't been able to try that yet." If there are many comments, please address them all. If the suggestions given did not help, please give particulars such as error messages or other events that may have occurred. If the experts have asked questions, please respond to them to help them find a resolution to your issue. Please do not ignore them.

*If this issue remains unresolved, you may want to post a new, 0-point question here in this topic area with a link to this question in it to attract other experts.

*Award points for solutions. If one of the suggestions did work or if an expert put in a good effort toward resolving your issue, please award the points to that expert by clicking on the button above that expert's post that says "Accept comment as answer".

*If you have resolved this issue in another manner, please share it with us. We will refund your points and store the question in the database so others might get value from it.

*If you have given up on this issue, and prefer to delete it, you can request that, but the experts may choose to argue that they have worked hard to help you, and the moderator will make final determination if necessary.

*Most importantly, be fair in your grading. Please see guidelines for grading at
http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp#3
If you give any grade less than an A without stating why, the grade will be changed upon request by the expert.

Thanks very much for being fair to our experts.



-----Experts-----

*Do not provide further support to this question unless the Asker responds that it is not yet resolved and wishes to continue to get help.

*If you truly believe that your answer is the best one that has been provided, please state which comment you made that you believe to be correct. If no one argues your comment, you will be awarded the points.

*If you would like to *vote* for another expert's comment, feel free to do so. Likewise, feel free to argue (nicely) any points that other experts make. We want everyone's input to be considered. Unless it is really unavoidable, vote only for one expert's response--it is quite a bit of work to split points, and many people come and go from the site and never see the "Points for" questions.

*Please don't thank the moderator for granting points to you. This only causes more email for the moderator, and I can personally attest to literally 100s of emails a day. Your thoughts are no less appreciated! We are experts too.

*Finally, if you ever question a moderator's determination, don't hesitate to do so right in the question in question. If you feel you want to voice your comment privately, email me at amp@experts-exchange.com.

Your input is extremely valuable and very much appreciated.

thank you
amp
community support moderator

Author

Commented:
Thanks for the Solution I have been away for awhile.

Thank YOU for responding, krp9711!

amp
community support moderator

Explore More ContentExplore courses, solutions, and other research materials related to this topic.