zoukankan
html css js c++ java
javascript操作粘贴板
<
body
MS_POSITIONING
="GridLayout"
>
<
script
type
="text/javascript"
>
<!--
function
clip(text)
{
//
str=eval("document.getElementById('copy1')");
//
str.select();
//
str = document.selection.createRange();
//
clipboardData.setData('text',(str.text));
var
sel
=
document.body.createTextRange();
sel.moveToElementText(document.getElementById(
'
copy
'
));
//
此处form是页面form的id
sel.select();
sel.execCommand(
"
Copy
"
);
}
//
-->
</
script
>
<
form
id
="Form1"
method
="post"
runat
="server"
>
<
a
href
="javascript:clip()"
>
复制到剪贴板
</
a
><
br
>
<
asp:Label
id
="copy"
style
="Z-INDEX: 102; LEFT: 48px; POSITION: absolute; TOP: 96px"
runat
="server"
>
2
<
sup
>
2
</
sup
></
asp:Label
>
</
form
>
</
body
>
1
.首先用后台语言从数据库里读取数据
2
.把从数据库里读取到的数据用javascript操作付到页面中去。
eg:
function replaceDate()
{
if
(isNewSign
==
"
none
"
)
{
if
(TANGER_OCX_OBJ
!=
""
)
{
var myDocApp
=
TANGER_OCX_OBJ;
//
****************Word替换文字型窗体区域书签内容*******************
//
只能替换一次
myDocApp.ActiveDocument.FormFields(
"
recfilecode
"
).Range
=
recfilecode;
myDocApp.ActiveDocument.FormFields(
"
recfileno
"
).Range
=
recfileno;
myDocApp.ActiveDocument.FormFields(
"
recfilemj
"
).Range
=
recfilemj;
myDocApp.ActiveDocument.FormFields(
"
recfileyear
"
).Range
=
recfileyear;
myDocApp.ActiveDocument.FormFields(
"
recfilemonth
"
).Range
=
recfilemonth;
myDocApp.ActiveDocument.FormFields(
"
recfileday
"
).Range
=
recfileday;
myDocApp.ActiveDocument.FormFields(
"
recfiletitle
"
).Range
=
recfiletitle;
myDocApp.ActiveDocument.FormFields(
"
recfileunite
"
).Range
=
recfileunite;
}
}
说明:
1
)FormFields是word中的属性,
2
)ActiveDocument(NTKO中的属性):返回文档对象的自动化接口
3
)(
"
recfilecode
"
)为word摸板中的字段名
查看全文
相关阅读:
004.Docker镜像管理
001.Heartbeat简介
005.Docker存储管理
006.Docker网络管理
012.Docker仓库管理
013.Docker私有仓库多Harbor同步部署
007.基于Docker的Etcd分布式部署
008.Docker Flannel+Etcd分布式网络部署
009.Docker Compose部署及基础使用
002.Open-Falcon Server部署及Agent监控
原文地址:https://www.cnblogs.com/sunheyubo/p/1134949.html
最新文章
virutalenvwrapper安装和使用
【MySQL】Docker搭建MySQL8.0
【PG】PostgreSQL12安装
简说Python之flask初体验
简说python之初连ORACLE数据库
简说Python之面向对象
简说Python之函数
SpringMVC 快速入门
Spring4 事务管理
Spring4 JDBC详解
热门文章
Spring4 AOP详解
Spring4 IOC详解
Spring4 快速入门
[ASP.NET教程] 防止表单重复提交
002.Kickstart部署之NFS架构
附006.harbor.cfg配置文件详解
001.Docker简介概述
002.Docker安装部署
002.AnyCast技术浅析
003.Docker容器管理
Copyright © 2011-2022 走看看