【发布时间】:2020-03-11 01:34:39
【问题描述】:
我在 Microsoft Publisher 中创建了一个模板,上面有一些“图片占位符”。我已通读文档,但无法弄清楚如何以编程方式设置占位符的图像。
Private Sub Document_Open()
Dim shp As Shape
For Each shp In ActiveDocument.Pages(1).Shapes
If shp.AlternativeText = "Image1" Then
' I want to set the image here, something like shp.Image = "C:\blah.jpg"
Debug.Print ("Got to image 1")
ElseIf shp.AlternativeText = "Image2" Then
Debug.Print ("Got to image 2")
Else
End If
Next shp
End Sub
【问题讨论】:
标签: vba placeholder publisher