python with ofllok win32.client问题

发布于 2025-01-28 10:10:47 字数 1843 浏览 1 评论 0原文

我正在尝试使用win32.clationt导入的python 3.9中的“收件人” Outlook对象,但只能访问“收件人”。收件人没有“地址”属性,但是“收件人”确实可以根据需要从发件箱获取收件人的电子邮件地址。任何人都可以处理或其他推荐的图书馆来实现这一目标吗?存在收件人对象,我只是无法访问它。


    import win32com.client as win32
    import os
    from datetime import datetime, timedelta 
    messageobjectlist = []
    reciplist = []
    messages = outbox.Items
    received_dt = datetime.now() - timedelta(days=1)
    received_dt = received_dt.strftime('%m/%d/%Y %H:%M %p')
    messages = messages.Restrict("[ReceivedTime] >= '" + received_dt + "'")
    for each in messages:
        if each.Class == 43:
            messageobjectlist.append(each)
    for x in messageobjectlist:
           reciplist.append(x.Recipients) #this is the problem, if i try to grab addresses from this, "recipients" does not have the property, only "recipient" does, but python tells me "recipient" is unknown
           print(x)
    for y in reciplist:
        print(y)
#this is the output from the code above, unknown coms instead of desired addresses
back up code
RE: Group Kickoff
RE: Thank You
RE: spac-research_1652212493196.csv
Outlook Programmatic Permissions
RE:  (cmts 5.10.22)
RE:  - Fully Executed LOE
RE:  - Fully Executed LOE
RE:  - Fully Executed LOE
FW: logo
RE: Expense report
RE: Expenses - Moving & November Visit 
FW: Thank You
RE: - Advisory (May 2022) (cmts 5.10.22)
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>

i am trying to access the "recipient" outlook object in python 3.9 using win32.clients import, but can only access "recipients". Recipients does not have an "address" property, but "recipient" does to get the recipients email address from an outbox as desired. anyone have a work around or other recommended libraries to accomplish this? the recipient object exists, i just cant access it learn.microsoft.com/en-us/office/vba/api/outlook.recipient


    import win32com.client as win32
    import os
    from datetime import datetime, timedelta 
    messageobjectlist = []
    reciplist = []
    messages = outbox.Items
    received_dt = datetime.now() - timedelta(days=1)
    received_dt = received_dt.strftime('%m/%d/%Y %H:%M %p')
    messages = messages.Restrict("[ReceivedTime] >= '" + received_dt + "'")
    for each in messages:
        if each.Class == 43:
            messageobjectlist.append(each)
    for x in messageobjectlist:
           reciplist.append(x.Recipients) #this is the problem, if i try to grab addresses from this, "recipients" does not have the property, only "recipient" does, but python tells me "recipient" is unknown
           print(x)
    for y in reciplist:
        print(y)
#this is the output from the code above, unknown coms instead of desired addresses
back up code
RE: Group Kickoff
RE: Thank You
RE: spac-research_1652212493196.csv
Outlook Programmatic Permissions
RE:  (cmts 5.10.22)
RE:  - Fully Executed LOE
RE:  - Fully Executed LOE
RE:  - Fully Executed LOE
FW: logo
RE: Expense report
RE: Expenses - Moving & November Visit 
FW: Thank You
RE: - Advisory (May 2022) (cmts 5.10.22)
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文