[英]Embed Object in Specific Cell In Table in a Word Document Using VBA
As of now I can only embed the document through this code: 到目前为止,我只能通过以下代码嵌入文档:
Dim wordDoc as word.document
wordDoc.InlineShapes.AddOLEObject Filename:="C:/Doc.doc", Linktofile:=False, DisplayAsIcon:=True, IconLabel:="Sample"
The problem is I want to embed the object to specific cells in a table. 问题是我想将对象嵌入表中的特定单元格。 What's happening is it inserts to the first cell only.
发生的事情是它仅插入第一个单元格。 I;v tried to searched but with no luck.
我; v试图搜寻,但没有运气。 I'm a newbie in VBA so please help me.
我是VBA的新手,所以请帮助我。 Thanks.
谢谢。 :)
:)
它将是这样的:
ActiveDocument.Tables(1).Columns(2).Cells(2).Range.InlineShapes.AddOLEObject Filename:="C:/Doc.doc", Linktofile:=False, DisplayAsIcon:=True, IconLabel:="Sample"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.