Example #1
0
        static public bool StartAndInitializeOutlook(  )
        {
            if (OutlookSession.IsOutlookRun)
            {
                return(true);
            }

            _com_OutlookExporer explorer = null;

            try
            {
                OutlookGUIInit.StartOutlook(ProcessWindowStyle.Minimized);
                IntPtr mainWnd = OutlookGUIInit.PrepareMainWndReady(2000);
                if ((int)mainWnd == 0)
                {
                    return(false);
                }
                ActivateGUI(mainWnd);
                return(IsOutlookExplorerReady(2000) != null);
            }
            catch (COMException exception)
            {
                Tracer._TraceException(exception);
                return(false);
            }
            finally
            {
                if (explorer != null)
                {
                    try
                    {
                        explorer.Release();
                    }
                    catch (COMException exception)
                    {
                        Tracer._TraceException(exception);
                    }
                }
            }
        }
Example #2
0
 private bool IsMainWndReady( )
 {
     _mainWnd = OutlookGUIInit.PrepareMainWndReady(cTimeOut);
     return((int)_mainWnd != 0);
 }