IT人士的平台 2009-01-12
使用的Eclipse版本:3.3.1
使用的jdk版本:5.0
显示结果:
注意
<!--[if !supportLists]-->嵌入Excel的方法是createExcelPart(Shell shell)
<!--[if !supportLists]-->Excel.Sheet为Excel的Id,如果要嵌入Word,则其Id为Word.Document
<!--[endif]-->这是OleClientSite#doVerb()的参数的解释及可选的值:
verb – an integer value mapping to one of the following pre-defined verb values:
<!--[if !supportLists]-->· <!--[endif]-->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.
<!--[if !supportLists]-->· <!--[endif]-->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.
<!--[if !supportLists]-->· <!--[endif]-->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.
<!--[if !supportLists]-->· <!--[endif]-->OLE.OLEIVERB_HIDE - Causes an object to remove its user interface from the view. Applies only to objects that are activated in-place.
<!--[if !supportLists]-->· <!--[endif]-->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.
<!--[if !supportLists]-->· <!--[endif]-->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.
<!--[if !supportLists]-->· <!--[endif]-->OLE.OLEIVERB_DISCARDUNDOSTATE - Used to tell objects to discard any undo state that they may be maintaining without deactivating the object.
如果光看解释看不明白的话,可以实际操作看看效果