office 2013破解教程
1、首先把下载好的office 2013激活工具压缩包解压
2、之后运行“Microsoft Toolkitexe”,可以选择以管理员身份运行
3、打开之后可以看到该程序右下角有office的图标,点击它(在这个过程中,必须运行office 2013中的程序)
4、之后会出现一个新的窗口,选择“Activation”,然后再选择下面的EZ-Activator,稍微等一会
5、然后可以看到下面会出现“Product activation successful”,就激活成功了
6、再打开office 2013就是已经激活好的
office 2013:>使用java中的io进行读取
BufferedReader bufferedReader = null;
File file = new File("文档地址+文档名docx");
if(!fileexists()){
Systemoutprintln("文件不存在");
} else {
bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "读取的字符格式(UTF-8或GBK)"));
String lineText = null;
while((lineText = bufferedReaderreadLine()) != null){
if (linText != null && !lineTexteq("")){
Systemoutprintln("一次读取一行,一行内容为:" + lineText);
}
}
}前提:
导入COM库:Microsoft word 110 Object Library
引用里面就增加了:
创建新Word
object oMissing = SystemReflectionMissingValue;
Word_Application oWord;
Word_Document oDoc;
oWord = new WordApplication();
oWordVisible = true;
oDoc = oWordDocumentsAdd(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
打开文档:
object oMissing = SystemReflectionMissingValue;
Word_Application oWord;
Word_Document oDoc;
oWord = new WordApplication();
oWordVisible = true;
object fileName = @"E:\CCCXCXX\TestDocdoc";
oDoc = oWordDocumentsOpen(ref fileName,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
导入模板
object oMissing = SystemReflectionMissingValue;
Word_Application oWord;
Word_Document oDoc;
oWord = new WordApplication();
oWordVisible = true;
object fileName = @"E:\XXXCCX\Testdoc";
oDoc = oWordDocumentsAdd(ref fileName, ref oMissing,
ref oMissing, ref oMissing);
添加新表
object oMissing = SystemReflectionMissingValue;
Word_Application oWord;
Word_Document oDoc;
oWord = new WordApplication();
oWordVisible = true;
oDoc = oWordDocumentsAdd(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
object start = 0;
object end = 0;
WordRange tableLocation = oDocRange(ref start, ref end);
oDocTablesAdd(tableLocation, 3, 4, ref oMissing, ref oMissing);
表插入行
object oMissing = SystemReflectionMissingValue;
Word_Application oWord;
Word_Document oDoc;
oWord = new WordApplication();
oWordVisible = true;
oDoc = oWordDocumentsAdd(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
object start = 0;
object end = 0;
WordRange tableLocation = oDocRange(ref start, ref end);
oDocTablesAdd(tableLocation, 3, 4, ref oMissing, ref oMissing);
WordTable newTable = oDocTables[1];
object beforeRow = newTableRows[1];
newTableRowsAdd(ref beforeRow);
单元格合并
object oMissing = SystemReflectionMissingValue;
Word_Application oWord;
Word_Document oDoc;
oWord = new WordApplication();
oWordVisible = true;
oDoc = oWordDocumentsAdd(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
object start = 0;
object end = 0;
WordRange tableLocation = oDocRange(ref start, ref end);
oDocTablesAdd(tableLocation, 3, 4, ref oMissing, ref oMissing);
WordTable newTable = oDocTables[1];
object beforeRow = newTableRows[1];
newTableRowsAdd(ref beforeRow);
WordCell cell = newTableCell(1, 1);
cellMerge(newTableCell(1, 2));
单元格分离
object oMissing = SystemReflectionMissingValue;
Word_Application oWord;
Word_Document oDoc;
oWord = new WordApplication();
oWordVisible = true;
oDoc = oWordDocumentsAdd(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
object start = 0;
object end = 0;
WordRange tableLocation = oDocRange(ref start, ref end);
oDocTablesAdd(tableLocation, 3, 4, ref oMissing, ref oMissing);
WordTable newTable = oDocTables[1];
object beforeRow = newTableRows[1];
newTableRowsAdd(ref beforeRow);
WordCell cell = newTableCell(1, 1);
cellMerge(newTableCell(1, 2));
object Rownum = 2;
object Columnnum = 2;
cellSplit(ref Rownum, ref Columnnum);
通过段落控制插入
object oMissing = SystemReflectionMissingValue;
object oEndOfDoc = "\\endofdoc"; /// \endofdoc is a predefined bookmark /
//Start Word and create a new document
Word_Application oWord;
Word_Document oDoc;
oWord = new WordApplication();
oWordVisible = true;
oDoc = oWordDocumentsAdd(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
//Insert a paragraph at the beginning of the document
WordParagraph oPara1;
oPara1 = oDocContentParagraphsAdd(ref oMissing);
oPara1RangeText = "Heading 1";
oPara1RangeFontBold = 1;
oPara1FormatSpaceAfter = 24; //24 pt spacing after paragraph
oPara1RangeInsertParagraphAfter();
打开word中的word文件“找不到服务器应用程序、源文件或项目”是因为关联文件丢失,系统的中关于DOC(DOCX)、XLS(XLSX)、PPT(PPTX)等文件与打开它们的程序之间的关联给弄丢了,重新编辑注册表即可解决,方法如下:
1、鼠标右键点击电脑桌面任意位置,选择新建。
2、点击文本文档。
3、双击打开新建的文本文档。
4、在文档内输入,如图所示。
Windows Registry Editor Version 500
[HKEY_CLASSES_ROOT\CLSID\{D70E31AD-2614-49F2-BOFC-ACA781D81F3E\AutoConvertTo]
@="{6A221957-2D85-42A7-8E19-BE33950D1DEB}"
[HKEY_CLASSES_ROOT\CLSID\{7AABBB95-79BE-4COF-8024-EB6AF271231C]\AutoConvertTo]
@="{6A221957-2D85-42A7-8E19-BE33950D1DEB}"
[HKEY_CLASSES_ROOT\CLSID\Y8E75D913-3D21-11D2-85C4-080009A0C626}\AutoConvertTo]
@="{6A221957-2D85-42A7-8E19-BE33950D1DEBy"
输入完成后按键盘上的CTRL+S保存此文档。
5、更改文档名后缀为reg。如图所示。
6、在d出来的界面点击是。如图所示。
7、双击此文档运行即可,这样注册表就重新编辑好了,重新打开word中的word文件就能打开了。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)