View Single Post
  #1  
Old January 25th 10, 04:16 AM posted to microsoft.public.outlook.program_addins
ron podl
external usenet poster
 
Posts: 4
Default how to (re)set the default data file for Outlook in a VB program

I want to be able to (re)set the default data file for Outlook 2007 in a VB
program (using Visual Studio 2008).
I would like to recognize which Store is the "default data file" and switch
the default to different file.
I'm assuming that, as the Outlook dialogs do, you can't remove the default
store until a new default is set.
See rough program outline.

For Each s as Store In outlookNS.Stores
dim NewName as String = appdata & "\" & Path.GetFileName(s.FilePath)
copy the original Store file to a new location (NewName)
outlookNS.AddStore(NewName)
if s.? is default data file then ' how can I find if it is the default?
find the store just added
make it the default data file ' how to set it?
end if
outlookNS.RemoveStore(s.GetRootFolder)
Next
Ads