Freeson Lee

Hi everyone, can anyone tell me how to set the Calendar option configuration in Outlook 2007 ( Tools->Options->Calendar Options) by VSTO Or does VSTO allow us to change calendar option

For example, i want to mark Friday as holiday.



Re: Visual Studio Tools for Office How to modify the setting in Calendar options?

Sue Mosher - Outlook MVP

The Outlook settings displayed in Tools | Options are not exposed in the Outlook object model. Most of those settings are managed by registry values; however, there is no guarantee that, if you change the value programmatically in a VSTO add-in, Outlook will actually reload it.

The work week is stored under HKCU\Software\Microsoft\Office\12.0\Outlook\Options\Calendar in a DWORD value named Workday. I'll leave it to you to experiment to determine the value you need.





Re: Visual Studio Tools for Office How to modify the setting in Calendar options?

Freeson Lee

Oh. I changed the value, It seems that Outlook doesn't load setting from there. I close Outlook, change value, restart Outlook, the setting is still the value that before my change.

I am sure that the new value I changed is legal by Outlook.




Re: Visual Studio Tools for Office How to modify the setting in Calendar options?

Sue Mosher - Outlook MVP

What value did you use Did Outlook completely shut down before you restarted it Check in Task Manager.





Re: Visual Studio Tools for Office How to modify the setting in Calendar options?

Freeson Lee

The value is "0x80". I mark only Sunday as holiday and then check the Widnows Registry, the value is "0x80". Then I mark both Sunday and Monday as holiday and OK and shutdown Outlook. I also check in the Task Manager, Outlook process is still there. I wait about 10 seconds and end the process by click "End Process".

Then change value in registry and set from "0xc0" to "0x80".

Restart Outlook.

That's my whole process of it.





Re: Visual Studio Tools for Office How to modify the setting in Calendar options?

Ji Zhou ¨C MSFT

Hi Freeson,

I can reproduce what you said. And I find when change it from 0 to other legal value in the registry. It works fine. However, I will mark Sue¡¯s first post as answer, because this issue is no longer a VSTO related one.

I do not know why it loads the value from the registry only in condition that the original value is 0. It seems that there are other rules in the loading process. I recommend you to post the issue in Office Product News Group to see if experts there have an idea about this behavior. Wish you a good luck!

http://www.microsoft.com/technet/community/newsgroups/dgbrowser/en-us/default.mspx dg=microsoft.public.office.misc&lang=en&cr=US

Thanks

Ji