Home >Web Front-end >JS Tutorial >Implementation code for copying web content to WORD based on jquery_jquery

Implementation code for copying web content to WORD based on jquery_jquery

WBOY
WBOYOriginal
2016-05-16 18:10:441116browse
复制代码 代码如下:

$('#eTableWord').click(
function() {
var oWD = new ActiveXObject("Word.Application");
var oDC = oWD.Documents.Add("", 0, 1);
var oRange = oDC.Range(0, 1);
var sel = document.body.createTextRange();
sel.moveToElementText(dataTable);
sel.select();
sel.execCommand("Copy");
oRange.Paste();
oWD.Application.Visible = true;
});
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn