【问题标题】:Using VBA in Microsoft Publisher, is it possible to set the image of a "Picture Placeholder"在 Microsoft Publisher 中使用 VBA,是否可以设置“图片占位符”的图像
【发布时间】: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


    【解决方案1】:

    对于任何想知道答案的人,我都能弄清楚:

    shp.PictureFormat.ReplaceEx ("FilePath")
    

    【讨论】:

      猜你喜欢
      • 2010-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-15
      • 2016-12-30
      • 2017-03-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多