/**/ ///_ Workbook XLS = app. workbooks. open (xlspath, ref o, ref O, ref o, ref O );
_ Workbook xls = App. workbooks. Open (xlspath, O, O );
Object Filename = Htmlpath;
Object Format = Excel. xlfileformat. xlhtml; // Html
// XLS. saveas (ref filename, ref format, ref o, ref O );
XLS. saveas (filename, format, O, xlsaveasaccessmode. xlexclusive, O, O );
// XLS. saveas (
Object T = True ;
App. Quit ();
Word. applicationclass word = New Word. applicationclass ();
Type wordtype = Word. GetType ();
Word. Documents docs = Word. documents;
// Open a file
Type docstype = Docs. GetType ();
// Raid.doc
// String newfilenamepath = This. server. mappath (mydata. config. sysuploadpath + "/" + filename );
String Newfilenamepath = This . Server. mappath ( " Download/ " + Filename );
Word. Document Doc = (Word. Document) docstype. invokemember
( " Open " , System. reflection. bindingflags. invokemethod, Null , Docs, New Object [] ... {Newfilenamepath,True,
True} );
// Convert the format and save it
Type doctype = Doc. GetType ();
Object Savefilename = Newfilenamepath. Replace ( " . Doc " , " . Htm " );
// The following is the Microsoft Word 9 Object Library statement. If it is 10, it may be written as follows:
/**/ /*
Doctype. invokemember ("saveas", system. reflection. bindingflags. invokemethod,
Null, Doc, new object [] {savefilename, word. wdsaveformat. wdformatfilteredhtml });
*/
/**/ /// Other formats:
/// Wdformathtml
/// Wdformatdocument
/// Wdformatdostext
/// Wdformatdostextlinebreaks
/// Wdformatencodedtext
/// Wdformatrtf
/// Wdformattemplate
/// Wdformattext
/// Wdformattextlinebreaks
/// Wdformatunicodetext
Doctype. invokemember ( " Saveas " , System. reflection. bindingflags. invokemethod, Null , Doc, New Object [] ... {Savefilename, word. wdsaveformat. wdformathtml} );
// Exit word
Wordtype. invokemember ( " Quit " , System. reflection. bindingflags. invokemethod, Null , Word, Null );
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service