添加图片“下边距”

时间:2019-07-11 11:32:47

标签: vba ms-word

我有一些代码可以将图像放置到文档中。如果页脚中已经有表格,则图像显示在错误的位置。

如果我手动将垂直位置从“段落”下方的0.44更改为“底部页边距”以下,则所有文档的正确位置都将变为正确的位置。

但是在vba中看不到任何访问此选项的方法。

{"crawlDate": "2019-07-03 20:03:44", "Code": "200", "c1": "XYZ", "desc": "desc",  "attributes": {"abc":123, "def":456}}
{"crawlDate": "2019-07-04 20:03:44", "Code": "200", "c1": "ABC", "desc": "desc1"}
{"crawlDate": "2019-07-04 20:03:44", "Code": "200", "c1": "ABC", "desc": "desc1", "attributes": {"abc":456, "def":123}}

还有其他方法可以执行此操作吗?或者我错过了一些有关修改图像绝对位置的内容吗?

1 个答案:

答案 0 :(得分:1)

如下修改您的With部分:

With oWD.Sections(Sctn.Index).Footers(wdHeaderFooterPrimary).Shapes.AddPicture(img)
      ' for absolute positioning
      .Left = CentimetersToPoints(15.75)
      .RelativeVerticalPosition =  wdRelativeVerticalPositionBottomMarginArea
      .Top = CentimetersToPoints(0.44)
      .TopRelative = wdShapePositionRelativeNone
    End With