- Joined
- Feb 12, 2008
- Messages
- 1
- Reaction score
- 0
Hi,
I am trying to set MS Outlook to "Work Offline" from within C#. I have managed to figure out how to read the offline status of Outlook from within C# using the code below:
Outlook.Application oOutlook = new Outlook.ApplicationClass();
Outlook.NameSpace oNameSpace = oOutlook.GetNamespace("MAPI");
if (oNameSpace.Offline){
LogMessage("Outlook Offline\n");}
else{
LogMessage("Outlook Online\n");}
I can't however see how one would SET it to Offline. I know that one is able to set folders to offline but I need to set the program to offline (i.e. the same process as clicking File-> Work Offline in Outlook).
Does anyone have any advice on how to do this!
Thanks in advance.
I am trying to set MS Outlook to "Work Offline" from within C#. I have managed to figure out how to read the offline status of Outlook from within C# using the code below:
Outlook.Application oOutlook = new Outlook.ApplicationClass();
Outlook.NameSpace oNameSpace = oOutlook.GetNamespace("MAPI");
if (oNameSpace.Offline){
LogMessage("Outlook Offline\n");}
else{
LogMessage("Outlook Online\n");}
I can't however see how one would SET it to Offline. I know that one is able to set folders to offline but I need to set the program to offline (i.e. the same process as clicking File-> Work Offline in Outlook).
Does anyone have any advice on how to do this!
Thanks in advance.