using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
using Microsoft.Office.Interop.Outlook;
using System.Reflection;
namespace OfficeUtility
{
/// <summary>
/// Start an outlook process
/// </summary>
public class OutlookApp : IDisposable
{
[DllImport("user32.dll")]
static extern int GetWindowThreadProcessId(int hWnd, out int lpdwProcessId);
private Application outlookAppInstance = null;
public Application OutlookAppInstance
{
get { return outlookAppInstance; }
set { outlookAppInstance = value; }
}
public OutlookApp()
{
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
outlookAppInstance = new Microsoft.Office.Interop.Outlook.Application();
}
#region IDisposable Members
public void Dispose()
{
//if (outlookAppInstance != null)
//{
// outlookAppInstance.Quit();
//}
//Thread.Sleep(1000);
}
#endregion
}
}
引用Microsoft.Office.Interop.Outlook