CS0012: 类型“Microsoft.Office.Core.MsoZOrderCmd”在未被引用的程序集中定义
文档加水印的方法 。但运行报下面错误 请教。。。
public void show()
{
object Nothing = System.Reflection.Missing.Value;
Word.ApplicationClass wordAppObj = null;
Word.Document WordDoc = null;
try
{
// object srcFileName = Server.MapPath("Documnets") + "/ProjectTmp.doc";
// object dstFileName = Server.MapPath("Documnets") + "/Project.doc";
string FileName = Server.MapPath("~/UpLoad") + "/water.gif";
object srcFileName = "C:\\公司框架.doc";
object dstFileName = "C:\\公司框架.doc";
object obj = true;
wordAppObj = new Word.ApplicationClass();
WordDoc = wordAppObj.Documents.Open(ref srcFileName, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
this.CreateWaterMarkImg("与电子文本一致", WordDoc.ActiveWindow.Height, WordDoc.ActiveWindow.Width, WordDoc.ActiveWindow.Width, WordDoc.ActiveWindow.Height);
Word.Shape oShape;
WordDoc.ActiveWindow.View.Type = Word.WdViewType.wdOutlineView;
WordDoc.ActiveWindow.View.SeekView = Word.WdSeekView.wdSeekPrimaryHeader;
// WordDoc.ActiveWindow.ActivePane.Selection.InsertAfter(DateTime.Now.ToString("yyyyMMddhhssmm"));
object top = 36;
oShape = WordDoc.ActiveWindow.ActivePane.Selection.HeaderFooter.Shapes.AddPicture(FileName, ref Nothing,
ref Nothing, ref Nothing, ref top, ref Nothing, ref Nothing, ref Nothing);
oShape.WrapFormat.Type = Word.WdWrapType.wdWrapInline;
oShape.ZOrder(Microsoft.Office.Core.MsoZOrderCmd.msoSendBehindText);
WordDoc.SaveAs(ref dstFileName, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
}
catch (Exception ex)
{
}
finally
{
WordDoc.Close(ref Nothing, ref Nothing, ref Nothing);
wordAppObj.Quit(ref Nothing, ref Nothing, ref Nothing);
}
}