The following code adds a Microsoft Excel worksheet to the RichTextBox and sets its Key property to "SalesData":RichTextBox1.OLEObjects.Add , "SalesData", , "Excel.Sheet.5"When an object is added to the collection, it immediately becomes in-place active so the user can add data to it
现在的问题是如何让它不 immediately becomes in-place active  ~~~~~!!!!原帖地址:
http://expert.csdn.net/Expert/topic/2884/2884662.xml?temp=.7044947
http://expert.csdn.net/Expert/topic/2886/2886006.xml?temp=.9262506

解决方案 »

  1.   

    请问 supergreenbean(超级绿豆)在VB中如何实现?
    谢谢
      

  2.   

    很不幸,IRichEditOle接口没有任何现成的类型库可以用。在C里面用很简单,你可以看一下MSDN,在VB里就很麻烦了
      

  3.   

    //请问 supergreenbean(超级绿豆)在VB中如何实现用richtextbox实现不了,参考:
    http://www.vbaccelerator.com/codelib/richedit/vbalrall.zip
      

  4.   

    不过,你这样看看,是不是你想要的效果Dim o As OLEObject
    Set o = RichTextBox1.OLEObjects.Add(, "SalesData", , "Excel.Sheet.5")
    o.DisplayType = rtfDisplayIcon
    o.DisplayType = rtfDisplayContent