繁体   English   中英

从Silverlight将工作表添加到Powerpoint演示文稿中

[英]Adding a worksheet to a Powerpoint presentation from silverlight

我正在使用Silverlight客户端应用程序,该应用程序将创建包含excel工作簿表的PowerPoint演示文稿。

通过Office api,我能找到的最好方法是以编程方式创建excel工作表,保存到临时文件,然后在powerpoint api上对shape对象使用AddOLEObject方法。

http://msdn.microsoft.com/zh-cn/library/microsoft.office.interop.powerpoint.shapes.addoleobject.aspx

有一个更好的方法吗?

创建电子表格后,将所需范围复制到剪贴板,然后复制PowerPoint对象:

With oPPTPresentation.Slides(SlideIndex)
.Shapes.PasteSpecial (ppPasteOLEObject)
End With

或者,如果您需要移动/调整大小:

With oPPTPresentation.Slides(SlideIndex)
Set oPPTShape = .Shapes.PasteSpecial(ppPasteOLEObject)(1)
With oPPTShape
End With   ' shape
End With   ' presentation

简而言之,就是VBA。 剩下的翻译成.NETshell是读者的练习。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM