【问题标题】:selenium sendkeys() to write email into outlookselenium sendkeys() 将电子邮件写入 Outlook
【发布时间】:2017-08-21 00:59:57
【问题描述】:

如何使用 selenium 根据从数据库中获取的数据将表插入到 Outlook 中?

我正在使用 send keys() 将数据写入 Outlook,但我需要带有列名的表格或网格视图形式的数据。

我能够获取数据并作为发送键(数据)发送到 Outlook,但表格形式是必需的。

【问题讨论】:

  • 您可以模拟鼠标点击表格按钮进行插入,然后将数据插入该表格中。
  • 您能向我们展示您的作品吗?

标签: java selenium autoit


【解决方案1】:

你可以试试OutlookEX UDF

准备邮件正文为html:

local $Array[][] = [[0,1,2,3],[0,1,2,3]]

local $content = ""

for $i=0 to UBound($Array)-1
    $content &= "<tr>"
    for $j = 0 to UBound($Array,2)-1
        $content &= "<td>" & $Array[$i][$j] & "</td>"
    Next
    $content &= "</tr>"
Next

$html = "<table border=1 cellspacing=0 cellpadding=0>" & $content & "</table>"

并使用 _OL_Wrapper_SendMail 功能:

#include <OutlookEx.au3>
$oOL = _OL_Open()
_OL_Wrapper_SendMail($oOL, "John Doe", "", "", $html, "", $olFormatHTML, $olImportanceHigh)
_OL_Close($oOL)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-09-25
    • 2016-02-05
    • 1970-01-01
    • 1970-01-01
    • 2022-07-15
    • 2010-09-28
    相关资源
    最近更新 更多