c#操作word表格(14) #endregion
} catch { wordDoc.Close(ref Nothing, ref Nothing, ref Nothing); wordApp.Quit(ref Nothing, ref Nothing, ref Nothing); if ( wordDoc != null ) { System.Runtime.InteropServices.Marshal.ReleaseComObject(wordDoc); wordDoc = null; } if ( wordApp != null ) { System.Runtime.InteropServices.Marshal.ReleaseComObject(wordApp); wordApp = null; } GC.Collect(); utility.ShowPopMessage("文档生成失败!");
} }