问题描述
#region - 页面设置 -publicstaticvoidSetPage(Orientationorientation,doublewidth,doubleheight,doubletopMargin,doubleleftMargin,doublerightMargin,doublebottomMargin){oDoc.PageSetup.PageWidth=oWord.CentimetersToPoints((float)width);oDoc.PageSetup.PageHeight=oWord.CentimetersToPoints((float)height);if(orientation==Orientation.横板){oDoc.PageSetup.Orientation=Microsoft.Office.Interop.Word.WdOrientation.wdOrientLandscape;}oDoc.PageSetup.TopMargin=(float)(topMargin*25);//上边距 oDoc.PageSetup.LeftMargin=(float)(leftMargin*25);//左边距 oDoc.PageSetup.RightMargin=(float)(rightMargin*25);//右边距 oDoc.PageSetup.BottomMargin=(float)(bottomMargin*25);//下边距}publicstaticvoidSetPage(Orientationorientation,doubletopMargin,doubleleftMargin,doublerightMargin,doublebottomMargin){SetPage(orientation,21,29.7,topMargin,leftMargin,rightMargin,bottomMargin);}publicstaticvoidSetPage(doubletopMargin,doubleleftMargin,doublerightMargin,doublebottomMargin){SetPage(Orientation.竖板,21,29.7,topMargin,leftMargin,rightMargin,bottomMargin);}#endregion
解决方案
解决方案二:
我也是这个问题,程序去word中读取完第一遍,写入Excel后,再回来读取别的信息就会出现"异常来自于HRESULT:0X800706BA",怎么解决啊,是不是我把word组件关了的原因,但是我再一次打开组件还是这个问题啊,求助啊
解决方案三:
http://topic.csdn.net/u/20100203/10/17c80c2f-43dd-4830-a51c-00f8a85db461.html
解决方案四:
遇到过,但是忘了怎么解决了,呵呵,帮顶把