设为首页 加入收藏

TOP

在SWT中使用OLE操纵Excel
2014-11-24 01:37:44 来源: 作者: 【 】 浏览:0
Tags:SWT 使用 OLE 操纵 Excel

使用的Eclipse版本:3.3.1


使用的jdk版本:5.0



显示结果:




注意


嵌入Excel的方法是createExcelPart(Shell shell)


Excel.SheetExcelId,如果要嵌入Word,则其IdWord.Document


这是OleClientSite#doVerb()的参数的解释及可选的值:


verb – an integer value mapping to one of the following pre-defined verb values:


· OLE.OLEIVERB_PRIMARY - Specifies the action that occurs when an end user double-clicks the object in its container. The object, not the container, determines this action. If the object supports in-place activation, the primary verb usually activates the object in place.


· OLE.OLEIVERB_SHOW - Instructs an object to show itself for editing or viewing. Called to display newly inserted objects for initial editing and to show link sources. Usually an alias for some other object-defined verb.


· OLE.OLEIVERB_OPEN - Instructs an object, including one that otherwise supports in-place activation, to open itself for editing in a window separate from that of its container. If the object does not support in-place activation, this verb has the same semantics as OLEIVERB_SHOW.


· OLE.OLEIVERB_HIDE - Causes an object to remove its user interface from the view. Applies only to objects that are activated in-place.


· OLE.OLEIVERB_INPLACEACTIVATE - Activates an object in place without displaying tools, such as menus and toolbars, that end users need to change the behavior or appearance of the object. Single-clicking such an object causes it to negotiate the display of its user-interface tools with its container. If the container refuses, the object remains active but without its tools displayed.


· OLE.OLEIVERB_UIACTIVATE - Activates an object in place, along with its full set of user-interface tools, including menus, toolbars, and its name in the title bar of the container window.


· OLE.OLEIVERB_DISCARDUNDOSTATE - Used to tell objects to discard any undo state that they may be maintaining without deactivating the object.


如果光看解释看不明白的话,可以实际操作看看效果


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Linux系统内核 2.6.28 五大特性 下一篇Linux Kernel 2.6.29 RC1已经发布

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: