ref varMissing, ref varMissing,
ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing)
varDoc.Activate(); //激活文档
object PrintToFile = true;
//打印成tif文件
varDoc.PrintOut(ref varMissing, ref varMissing, ref varMissing, ref OutputFileName, ref varMissing,
ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref PrintToFile,
ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing);
object saveChange = WdSaveOptions.wdSaveChanges; //关闭word文档时不打开新窗体
varDoc.Close(ref saveChange, ref varMissing, ref varMissing); //关闭word文档
varWord.Quit(ref varMissing, ref varMissing, ref varMissing); //退出Word
}
catch (Exception ex)
...{
throw new Exception(ex.Message);
}
}
/**//// <summary>
/// 将无后缀名的生成文件重命名为tif文件
/// </summary>
/// <param name="filePath">生成的无后缀名的文件路径</param>
public void ReNameToTif()
...{
string newTifPath = "";
if (File.Exists(tifPath))
...{
newTifPath = tifPath + ".tif";
File.Move(tifPath, newTifPath);
}
}
}