?? quick123.java
字號:
import Lot123.*;
public class Quick123
{
public static void main(java.lang.String[] args) {
Application app;
Ranges ranges;
Document doc;
Range rangeA1, rangeA2;
try {
// 建立com環境
com.ibm.bridge2java.OleEnvironment.Initialize();
// 創建一個新的用來啟動"123"的文檔
doc = new Document();
// 獲得 application object.
app = new Application(doc.get_Parent());
// 使application可見.
app.set_Visible(new Boolean("true"));
// 打開Range workbook.
doc = new Document(app.NewDocument());
// 獲得所有的 ranges.
ranges = new Ranges(doc.get_Ranges());
// 獲得cell A1.
rangeA1 = new Range(ranges.Item(new String("A1")) );
// 設置cell A1的內容
rangeA1.set_Contents("This is a test");
// 獲得 cell A2.
rangeA2 = new Range(ranges.Item(new String("A2")) );
// 把 cell A1 的內容復制給 cell A2
rangeA1.QuickCopy(rangeA2);
// 等待一秒
Thread.sleep(1000);
// 推出"123"并且不保存
app.Quit("false");
} catch (com.ibm.bridge2java.ComException e) {
// 處理com異常
System.out.println( "COM Exception:" );
System.out.println( Long.toHexString((e.getHResult())) );
System.out.println( e.getMessage() );
} catch (Exception e) {
System.out.println("message: " + e.getMessage());
} finally {
app = null;
com.ibm.bridge2java.OleEnvironment.UnInitialize();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -