Applescript:Can';t将日期和邮件内容从Outlook复制到Excel

Applescript:Can';t将日期和邮件内容从Outlook复制到Excel,excel,scripting,outlook,applescript,Excel,Scripting,Outlook,Applescript,我正在尝试从文件夹中复制outlook电子邮件,并将其复制到excel文档中。我目前有它拉的主题和发件人,但我有两个主要问题。第一,我不能用date属性提取日期。第二,我不能只提取邮件内容,因为它会从outlook邮件中提取所有HTML。这是我现在的全部代码 tell application "Microsoft Excel" set LinkRemoval to make new workbook set theSheet to active sheet of Link

我正在尝试从文件夹中复制outlook电子邮件,并将其复制到excel文档中。我目前有它拉的主题和发件人,但我有两个主要问题。第一,我不能用date属性提取日期。第二,我不能只提取邮件内容,因为它会从outlook邮件中提取所有HTML。这是我现在的全部代码

    tell application "Microsoft Excel"
    set LinkRemoval to make new workbook
    set theSheet to active sheet of LinkRemoval
    set formula of range "D1" of theSheet to "Message"
    set formula of range "C1" of theSheet to "Subject"
    set formula of range "B1" of theSheet to "From"
    set formula of range "A1" of theSheet to "Date"
end tell

tell application "Microsoft Outlook"
    activate
    set theRow to 2
    set theMessages to messages of mail folder "Requests"
    repeat with aMessage in theMessages
        my SetFrom(sender of aMessage, theRow, theSheet)
        my SetDate(date of aMessage, theRow, theSheet)
        my SetSubject(subject of aMessage, theRow, theSheet)
        my SetMessage(content of aMessage, theRow, theSheet)
        set theRow to theRow + 1
    end repeat
end tell

on SetDate(theDate, theRow, theSheet)
    tell application "Microsoft Excel"
        set theRange to "A" & theRow
        set formula of range theRange of theSheet to theDate
    end tell
end SetDate

on SetFrom(theSender, theRow, theSheet)
    tell application "Microsoft Excel"
        set theRange to "B" & theRow
        set formula of range theRange of theSheet to name of theSender
    end tell
end SetFrom

on SetSubject(theSubject, theRow, theSheet)
    tell application "Microsoft Excel"
        set theRange to "C" & theRow
        set formula of range theRange of theSheet to theSubject
    end tell
end SetSubject

on SetMessage(theMessage, theRow, theSheet)
    tell application "Microsoft Excel"
        set theRange to "D" & theRow
        set formula of range theRange of theSheet to theMessage
    end tell
end SetMessage
此外,当代码将消息内容粘贴到excel文件时,它不会粘贴所有文本,它只粘贴250个字符。。。见下图


我尝试了一些东西,发现了以下问题:

使用值
接收的时间
纯文本内容
,而不是
日期
内容

tell application "Microsoft Outlook"
    activate
    set theRow to 2
    set theMessages to messages of mail folder "Requests"
    repeat with aMessage in theMessages
        my SetFrom(sender of aMessage, theRow, theSheet)
        my SetDate(time received of aMessage, theRow, theSheet)
        my SetSubject(subject of aMessage, theRow, theSheet)
        my SetMessage(plain text content of aMessage, theRow, theSheet)
        set theRow to theRow + 1
    end repeat
end tell
关于另一个问题,我成功地使用
将单元格的值设置为…
而不是
将范围公式设置为…

on SetMessage(theMessage, theRow, theSheet)
    tell application "Microsoft Excel"
        set theRange to "D" & theRow
        set value of cell theRange of theSheet to theMessage
    end tell
end SetMessage
可见单元格的内容少于整个邮件内容,但您可以滚动浏览该单元格并找到整个(纯文本)内容

玩得开心,
迈克尔/汉堡/德国

哇。非常感谢你!为了找到答案,我花了很长时间在谷歌上搜索。请问您在哪里找到了有关接收时间和纯文本内容的信息?我什么也找不到,谢谢!如果发件人选择在电子邮件中包含他们的签名,您是否知道是否有办法删除邮件的签名?