如何使用 VBA 在 PowerPoint 2003 中复制行?
我需要在 PowerPoint 2003 中复制行(只是为了重新使用它们的格式)。尝试这样做:
Dim oPPTRow As PowerPoint.Row
Set oPPTRow = oPPTFile.Slides(SlideNum).Shapes(1).Table.Rows(2)
oPPTFile.Slides(SlideNum).Shapes(1).Table.Rows.Add (-1)
oPPTFile.Slides(SlideNum).Shapes(1).Table.Rows(oPPTTable.Rows.Count) = oPPTRow
但没有成功。还有其他方法可以达到同样的效果吗?
I need to copy rows in PowerPoint 2003 (just to re-use their formatting). Tried to do:
Dim oPPTRow As PowerPoint.Row
Set oPPTRow = oPPTFile.Slides(SlideNum).Shapes(1).Table.Rows(2)
oPPTFile.Slides(SlideNum).Shapes(1).Table.Rows.Add (-1)
oPPTFile.Slides(SlideNum).Shapes(1).Table.Rows(oPPTTable.Rows.Count) = oPPTRow
But it doesn't work. Is there any other way to achieve the same?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Rows.Add 方法允许您在所需的任何行之前插入新行。新插入的行将采用您之前插入的行的格式。试试这个(一定要先选择一个表格形状):
将 -1 作为参数传递给 .Add 强制 PPT 在表格末尾添加行;新单元格的格式将与其上面的单元格相同(即,之前位于底行的行中的单元格)。
如果您需要从其他行获取格式,我认为您可能需要执行以下操作:
The Rows.Add method lets you insert a new row before any row you like. The newly inserted row will pick up the formatting of the row you inserted it ahead of. Try this (be sure to select a tabel shape first):
Passing -1 as the parameter to .Add forces PPT to add the row at the end of the table; the new cells will all be formatted the same as the cells above them (that is, the cells in the row that was previously the bottom row).
If you need to pick up formatting from some other row, I think you may need to do something like: