提问人:Deuian 提问时间:11/7/2023 更新时间:11/7/2023 访问量:9
无法更改使用 Microsoft365R 列出的电子邮件的排序顺序
Unable to change sort order for emails listed using Microsoft365R
问:
使用库 Microsoft365R,我可以列出邮件,但它总是来自最旧的邮件,我不知道如何更改它以首先列出最新的邮件。
下面是我正在使用的示例代码,并尝试按接收的 desc 排序,接收的 asc 给出相同的输出。还列出了 300 封邮件,以显示有超过 100 封邮件,因此前 2 个列表应该具有不同的最大/最小接收日期
我希望 desc 和 asc 提供不同的邮件,或者如果邮件数量很少,它应该以不同的顺序排列。
#Load library
library(Microsoft365R)
#setup environment
outlb <- get_business_outlook()
#by = "received desc"
mails_desc <- outlb$list_emails(by = "received desc",filter = "startswith(sender/emailAddress/address,'[email protected]')", n = 100)
#by = "received asc"
mails_asc <- outlb$list_emails(by = "received asc",filter = "startswith(sender/emailAddress/address,'[email protected]')", n = 100)
#listed 300 to show there are more than 100 emails
mails_300 <- outlb$list_emails(filter = "startswith(sender/emailAddress/address,'[email protected]')", n = 300)
显示最小/最大 receivedDateTime 的输出
#by = “收到的 desc”
mails_desc[[1]]$properties$receivedDateTime [1] “2022-02-21T03:10:17Z” mails_desc[[100]]$properties$receivedDateTime [1] “2022-05-03T00:27:23Z"
#by = “收到的 ASC”
mails_asc[[1]]$properties$receivedDateTime [1] “2022-02-21T03:10:17Z” mails_asc[[100]]$properties$receivedDateTime [1] “2022-05-03T00:27:23Z"
#listed 300 表示有超过 100 封电子邮件
mails_300[[1]]$properties$receivedDateTime [1] “2022-02-21T03:10:17Z” mails_300[[300]]$properties$receivedDateTime [1] “2022-09-26T01:28:59Z"
答: 暂无答案
评论