用javascript中使用vba的问题

xjbx
领域专家: 编程技术技术领域
2002-03-28 11:12:21
在javascript中内嵌有关的vba代码,实现word的“痕迹保留”,但是无法实现,代码如下:
<script language=javascript>
function OpenWord()
{
onerror=errormsg;
ExcelSheet = new ActiveXObject("Word.Application");
ExcelSheet.parent.UserName = '';
ExcelSheet.parent.UserInitials = '';
ExcelSheet.parent.UserAddress = "";
ExcelSheet.showgrammaticalerrors=true; ExcelSheet.showspellingerrors=true;
ExcelSheet.TrackRevisions = true;
ExcelSheet.PrintRevisions = true;
ExcelSheet.ShowRevisions = true;
ExcelSheet.Application.Visible = true;
var mydoc=ExcelSheet.Documents.Add("",0,1);
myRange =mydoc.Range(0,1)
if(myEditor.document.body.innerText=="")
{
myEditor.document.body.innerText=" "
}
var sel=myEditor.document.body.createTextRange()
sel.select()
myEditor.document.execCommand('Copy')
sel.moveEnd('character')
myRange.Paste();
ExcelSheet.ActiveWindow.ActivePane.View.Type=3
wordflag=1
}
.....
<script>
其中实现“痕迹保留”的一段:
ExcelSheet.showgrammaticalerrors=true;
ExcelSheet.showspellingerrors=true;
ExcelSheet.TrackRevisions = true;
ExcelSheet.PrintRevisions = true;
ExcelSheet.ShowRevisions = true;
无法通过。
请高手指点,问题是出在那?谢谢
...全文
81 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
xjbx 2002-03-28
  • 打赏
  • 举报
回复
没人帮我么?

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧