Set Outlook to offline from C#

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.
 
Joined
Feb 27, 2011
Messages
1
Reaction score
0
Hi, have you ever been able to solve this problem?
I am facing the same problem right now... :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top