21
try
22
{
23
doc = app.documents.open(ref filename, ref missing, ref readonly,
24
ref missing, ref missing, ref missing, ref missing, ref missing,
25
ref missing, ref missing, ref missing, ref isvisible, ref missing,
26
ref missing, ref missing, ref missing);
27
28
doc.activewindow.selection.wholestory();
29
doc.activewindow.selection.copy();
30
//从剪切板获取数据
31
idataobject data=clipboard.getdataobject();
32
this.richtextbox1.text=data.getdata(dataformats.text).tostring();
33
34
}
35
finally
36
{
37
if (doc != null)
38
{
39
doc.close(ref missing, ref missing, ref missing);
40
doc = null;
41
}
42
43
if (app != null)
44
{
45
app.quit(ref missing, ref missing, ref missing);
46
app = null;
47
}
48
}
49
50
}
51
52
}