如何在Outlook电子邮件中插入文本框

问题描述 投票:1回答:1

作为自动化过程的一部分,我从VBA生成Outlook电子邮件,我正在努力在代码中将文本框插入电子邮件正文。

这些文本框将位于用于评论目的的特定位置。首先,我计划将它们包括在表格中,但是这些表格会改变主体的布局,我想避免这样做。

然后,我研究了z顺序之类的叠加方法,但无济于事。

是否可以通过VBA将覆盖的文本框插入到电子邮件正文的特定位置?在Outlook中,可以通过insert / textbox / draw textbox轻松完成此操作。

vba outlook ms-word outlook-vba
1个回答
0
投票

这里是有关如何将文本框添加到Outlook电子邮件的快速示例

Option Explicit
Public Sub Example()
    Dim Inspector As Outlook.Inspector
    Set Inspector = Application.ActiveInspector()

    Dim wdDoc As Word.Document
    Set wdDoc = Inspector.WordEditor

    'Add a text box
    Dim Shp As Word.Shape
    Set Shp = wdDoc.Shapes.AddTextbox _
                    (Orientation:=msoTextOrientationHorizontal, _
                    Left:=100, Top:=75, Width:=150, Height:=200)


    Set Inspector = Nothing
    Set wdDoc = Nothing
End Sub

[Remember to add reference to word xx object library] >>

[See how to delete as well

] >>
© www.soinside.com 2019 - 2024. All rights reserved.