---- The application environment of the server needs to be configured
VaR product_list = [];
--- Product_list value assignment;
VaR filename = "Document Template .docx"; var filernd = "upload/temp/" + session. sessionid. tostring () + parseint (math. random () * 1000000) + ". docx "; var FSO = new activexobject (" scripting. fileSystemObject "); var source = server. mappath (filename); var Destination = server. mappath (filernd); FSO. copyfile (source, destination, true); var T = false; var wordapp = new activexobject ("word. application "); try {wordapp. visible = false; wordapp. documents. open (destination); // writeln (destination); var wordarange = wordapp. activedocument. content; wordarange. find. execute ("{date0}", false, 1, true, date0, 2); wordarange. find. execute ("{date1}", false, 1, true, date1, 2); wordapp. activedocument. select (); // if the product array is too longCode If (wordapp. selection. find. execute ("{product_list}", false, 1, true) {wordapp. selection. typetext (str4html (product_list);} wordapp. activedocument. save (); wordapp. quit ();} catch (e ){}