// 全字匹配
Dispatch.put(find, "MatchWholeWord", "True");
if (!Dispatch.call(find,"Execute").getBoolean())
return 0;
else
{
int start = Dispatch.get(this.cursor, "Start").getInt();
Dispatch.put(this.cursor, "End", this.count);
//System.out.println(start);
return start;
}
}
public String getBetween(int start, int end) throws Exception
{
Dispatch range = Dispatch.get(this.cursor, "Range").toDispatch();
Dispatch.call(range,"SetRange", start, end);
return Dispatch.get(range, "Text").getString();
}
public String getLineAfter(int start) throws Exception
{
Dispatch.put(this.cursor, "Start", start);
int length = Dispatch.call(this.cursor, "EndKey").getInt() + start;
return getBetween(start, length);
}
public String getLine(int position) throws Exception
{
Dispatch.put(this.cursor, "Start", position);
Dispatch.call(this.cursor, "SelectRow");
int start = Dispatch.get(this.cursor, "Start").getInt();
int end = Dispatch.get(this.cursor, "End").getInt();
return getBetween(start, start + end);
}
public boolean gotoPage(int index) throws Exception
{
Dispatch.invoke(this.cursor, "Goto", Dispatch.Method, new Object[] {1, 2, String.valueOf(index)}, new int[1]);
//Dispatch.call(this.cursor, "GoTo", "wdGoToLine", "wdGoToNext", String.valueOf(index), null);
return true;
}
public int getCurrentCursor() throws Exception
{
return Dispatch.get(this.cursor, "Start").getInt();
}
public boolean setCursorMode() throws Exception
{
Dispatch.put(this.cursor, "End", Dispatch.get(this.cursor, "Start").getInt());
return true;
}
public boolean gotoHome() throws Exception
{
Dispatch.put(this.cursor, "Start", 0);
return true;
}