且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Javascript 获得Word application的版本号

更新时间:2022-09-06 07:47:32

在webclient的UI view html page里使用如下source code:

<%@page language="abap" %>
<%@extension name="thtmlb" prefix="thtmlb" %>
<%@extension name="chtmlb" prefix="chtmlb" %>
<%@extension name="bsp" prefix="bsp" %>
<thtmlb:textView id = 'Text_jerry1'/>
<script>
var app;
var version;

if ( thtmlbUtil.getBrowser() == isIE ) { <%-- this is a comment --%>
    try {
     app = GetObject("","Word.Application");
   } catch(e) {
     app = new ActiveXObject("Word.Application");
    }
  version = app.Version;
}
else {
   alert("not in IE");
}
<%
  DATA: lv_id TYPE string.
        lv_id = controller->get_id( 'Text_jerry1' ).
%>
var doc = document.getElementById("<%= lv_id %>");
doc.text = version;
doc.innerHTML = version;
</script>

使用Javascript 获得Word application的版本号