PageOffice 中能不能点一个按钮,执行 删除word表格 光标所在行?
1个回答
展开全部
C#中
后台添加代码如下:
PageOfficeCtrl1.AddCustomToolButton("删除光标所在行", "DeleteRow", 5);
Java中
引入包
<%@ page
import="com.zhuozhengsoft.pageoffice.*,com.zhuozhengsoft.pageoffice.wordwriter.*"%>
添加如下代码:
poCtrl1.addCustomToolButton("删除光标所在行", "DeleteRow()", 5);
在前台页面中添加javascript函数
<script type="text/javascript" language="javascript">
function DeleteRow()
{
var appObj = document.getElementById("PageOfficeCtrl1").Document.Application;
appObj.Selection.HomeKey(10);
appObj.Selection.EndKey(10, true);
appObj.Selection.Cells.Delete(2);
appObj.Selection.TypeBackspace();
}
</script>
后台添加代码如下:
PageOfficeCtrl1.AddCustomToolButton("删除光标所在行", "DeleteRow", 5);
Java中
引入包
<%@ page
import="com.zhuozhengsoft.pageoffice.*,com.zhuozhengsoft.pageoffice.wordwriter.*"%>
添加如下代码:
poCtrl1.addCustomToolButton("删除光标所在行", "DeleteRow()", 5);
在前台页面中添加javascript函数
<script type="text/javascript" language="javascript">
function DeleteRow()
{
var appObj = document.getElementById("PageOfficeCtrl1").Document.Application;
appObj.Selection.HomeKey(10);
appObj.Selection.EndKey(10, true);
appObj.Selection.Cells.Delete(2);
appObj.Selection.TypeBackspace();
}
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询