iWebOffice2004 invoke VBA script interpretation and translation
Source: Internet
Author: User
<script language=javascript>
System variables
var vfilename= ""; Open File name
var vobject=null; Open objects
var gfilename= ""; Filename
var gobject=null; Object
var Gopened=false; Whether or not to be opened
var gusername= ""; System User
</script>
<script language= "JScript" For=weboffice event= "ondocumentopened (vfilename,vobject)" >
Ondocumentopened (Vfilename,vobject); Open File Event
</script>
<script language= "JScript" For=weboffice event= "ondocumentclosed ()" >
Ondocumentclosed (); Close File Events
</script>
<script language=javascript>
Open the document, initialize the settings based on user rights (EditType)
function ondocumentopened (vfilename,vobject)
{
var mprotect,mtools,mtrack,mprint,mshow;
Gfilename=vfilename; Get global filename
Gobject=vobject; Get Global Object
Set traces and protection status
if (WebForm. weboffice.edittype== "0") {
Mprotect=true;
Mtools=false;
Mtrack=false;
Mprint=false;
Mshow=true;
}else if (WebForm. weboffice.edittype== "1") {
Mprotect=false;
Mtools=false;
Mtrack=false;
Mprint=false;
Mshow=false;
}else if (WebForm. weboffice.edittype== "2") {
Mprotect=false;
Mtools=false;
Mtrack=true;
Mprint=true;
Mshow=true;
}else if (WebForm. weboffice.edittype== "3") {
Mprotect=false;
Mtools=true;
Mtrack=true;
Mprint=true;
Mshow=true;
}else{
var mtype= "";
var medit=webform. Weboffice.edittype;
var midx=medit.indexof (",");
if (midx>0) {
Mtype=medit.substring (0,MIDX);
}
Medit=medit.substring (midx+1,medit.length);
Midx=medit.indexof (",");
if (midx>0) {
Mtype=medit.substring (0,MIDX);
if (mtype== "1") mprotect=true;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.