在Microsoft Publisher中使用VBA,是否可以设置;图片占位符“;
我在MicrosoftPublisher中创建了一个模板,上面有一些“图片占位符”。我已经阅读了文档,但不知道如何通过编程设置占位符的图像在Microsoft Publisher中使用VBA,是否可以设置;图片占位符“;,vba,placeholder,publisher,Vba,Placeholder,Publisher,我在MicrosoftPublisher中创建了一个模板,上面有一些“图片占位符”。我已经阅读了文档,但不知道如何通过编程设置占位符的图像 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 h
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
对于任何想知道答案的人,我都能找到答案:
shp.PictureFormat.ReplaceEx ("FilePath")