function authorPro(){
var user = document.getElementById("select");//获取用户
var passwd = null;
passwd = document.getElementById("passwd").value;//获取用户
var s = user.options[user.selectedIndex].value;//获取下拉框的index的值
ind = user.selectedIndex;//获取下拉框的index
if(passwd==""){
alert("please input password!");//如果用户没有输入密码,提示用户输入密码,才能操作相应的区域
}
else{
if(TANGER_OCX_OBJ.ActiveDocument.ProtectionType>=0)
{//判断当前文档是否处于保护状态,如果处于保护状态解开保护
TANGER_OCX_OBJ.ActiveDocument.Unprotect(passwd); //解开保护
TANGER_OCX_OBJ.ActiveDocument.Application.Selection.Editors(-1).Delete();//
}
TANGER_OCX_OBJ.ActiveDocument.Paragraphs(ind).Range.Select();//通过select的index设置相应的可操作的段落
TANGER_OCX_OBJ.ActiveDocument.Application.Selection.Editors.Add(-1);
TANGER_OCX_OBJ.ActiveDocument.Protect(3,false,passwd);//保护操作
}
}