现在的位置: 首页 > 综合 > 正文

c# office控件编程 生成文档进行局部限制编辑

2013年06月22日 ⁄ 综合 ⁄ 共 368字 ⁄ 字号 评论关闭

通过

1.书签成立

2.表格(行,列)可满足回车功能

3.段落

不通过

格式文本内容控件和纯文本内容控件的类似控件

 

核心代码

 //如果没有限制编辑为文档进行编辑限制
               if (newapp.ActiveDocument.ProtectionType == WdProtectionType.wdNoProtection)
               {
                   newapp.ActiveDocument.Protect(wdProtectionType, ref missing, ref Password);
               }
               object editorID = Microsoft.Office.Interop.Word.WdEditorType.wdEditorEveryone;
               newdoc.Bookmarks["yjff"].Range.Editors.Add(ref editorID);//课题的目标和主要研究内容

 

抱歉!评论已关闭.