omegahat / RDCOMClient

GNU General Public License v2.0
81 stars 35 forks source link

RDCOMClient MailItem HTMLbody does not work R v4.2.1 but it works for 3.6.3 #40

Open leeauk21 opened 2 years ago

leeauk21 commented 2 years ago

Mailitems HTMLBODY return empty string "" on R version 4.2.1 but it works for R version 3.6.3

library(RDCOMClient) library(dplyr) library(rvest) library(textutils) library(here) library(tidyr) library(readr) library(tidyverse) src_path = here::here()

OutApp <- COMCreate("Outlook.Application") OutStores <- OutApp$Session()$Stores() store_count <- OutStores$Count()

folder_name <- "Inbox" myfolder <- OutStores[[1]]$GetRootFolder()$folders(folder_name)

emails <- myfolder$Items n <- myfolder$Items()$Count() for (i in 1:n) { body <- emails(i)[['htmlbody']] print(body) }

duncantl commented 2 years ago

Hi We need an example with all of the code. We don't have the file scraping_utils.r.
Also, please remove any unnecessary code that is not needed to demonstrate the issue. Also, since this appears to be working on your mailbox, we cannot necessarily reproduce this with our own outlook mailbox. So in other words, we need a minimal reproducible example.

leeauk21 commented 2 years ago

Hi

Sorry about the code before. Everyone should be able to run this code as long as they have Outlook. Thanks!

lzuirm commented 1 year ago

Hi,

i have encountered the same issue here. An empty string "" is returned when calling emails(i)$HTMLBody() or emails(i)$Body() based on the code from leeauk21 above. R env 4.2.1, RDCOMClient version 0.96-1, MS Outlook version Microsoft 365 64 bit.

harryaustin24 commented 3 months ago

Hi, To flag I have just encountered this issue after updating R to 4.3.3. Having reverted back to R 4.0.5 I was able to run my email scraping script without any issues.