[DllImport("user32.dll")]
public extern static int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
/// <summary>
/// 打开ppt文件
/// </summary>
/// <param name="filePath">路径</param>
/// <returns></returns>
public string PPTOpen(string filePath)
{
StringBuilder s = new StringBuilder(512);
//防止连续打开多个PPT程序.
if (this.objApp != null)
{
this.objApp.Quit();
GC.Collect();
}
try
{
objApp = new POWERPOINT.Application();
//以非只读方式打开,方便操作结束后保存.
objPresSet = objApp.Presentations.Open(filePath, OFFICECORE.MsoTriState.msoFalse, OFFICECORE.MsoTriState.msoFalse, OFFICECORE.MsoTriState.msoFalse);
//objSlides = objPresSet.Slides;
//int[] SlideIdx = new int[3];
//fo