Slides output with 1 text +1 picture, 2 text + 1 picture我想再引入3个文本占位符,总共4个。我的图片在excel表的第4列。但是当我引入第2个文本占位符时,图片不在图片占位符中。所以,我修改了代码,
Sld.Shapes.Placeholders(1).TextFrame.TextRange.Text = DataRow.Cells(1, 1)
Sld.Shapes.Placeholders(2).TextFrame.TextRange.Text = DataRow.Cells(1, 2)
Sld.Shapes.Placeholders(3).TextFrame.TextRange.Text = DataRow.Cells(1, 3)
sCell = DataRow.Cells(1, 4).Address
' Check if there is a shp in Column 3
If objDic.exists(sCell) Then
objDic(sCell).Copy
Sld.Shapes.Placeholders(4).Select
Sld.Shapes.PasteSpecial DataType:=ppPasteMetafilePicture
End If
字符串
即使有4个文本占位符,输出也是一样的。图片不在PicturePlaceholder中。尝试了几次。无法弄清楚我哪里出错了?我可以得到帮助吗?
The first 2 rows are with images in textbox and the next two are imprted to cell as image without textbox我有一个三列的Excel表A,B和C。第一个两列有文本,第三列C有图像嵌入文本框。我有1000行。我想将这些列导出到PPT幻灯片。我在PPT的slidemaster中得到了三个占位符。前两个占位符用于插入文本,第三个用于插入图像。我已经写了一个vba宏,导出第一个两列的文本从Excel到PPT.工作正常.我想知道如何插入图像从Excel工作表的第三列(图像是在文本框)在第三个占位符意味着图像.该程序如下.
Sub LoopRowsSelected2Choices()
Dim DataRange As Range
Dim DataRow As Range
Dim AppPPT As PowerPoint.Application
Dim Prs As PowerPoint.Presentation
Dim Sld As PowerPoint.Slide
Set AppPPT = GetObject(, "PowerPoint.Application")
Set Pres = AppPPT.ActivePresentation
Set DataRange = Selection
For Each DataRow In DataRange.Rows
Set Sld = Pres.Slides.AddSlide(Pres.Slides.Count + 1, Pres.SlideMaster.CustomLayouts(2))
Sld.Shapes.Placeholders(1).TextFrame.TextRange.Text = DataRow.Cells(1, 1)
Sld.Shapes.Placeholders(2).TextFrame.TextRange.Text = DataRow.Cells(1, 2)
Next DataRow
End Sub
型
前两列的占位符工作正常。我在第三列的图像,并希望在PPT中的第三个占位符isert意味着图片。任何解决方案?提前感谢
我尝试并成功地插入了文本,但没有插入图像。
1条答案
按热度按时间2cmtqfgy1#
在单元格上添加图片是一个很好的方法,用JavaScript代码操作起来更容易。
字符串
Shapes.PasteSpecial method (PowerPoint)
的数据