3

I'm using the package RDCOMClient with R version 4.0.2. It was downloaded using:

devtools::install_github("omegahat/RDCOMClient")

I'd like to use the package for reading and writing email. I've started this way:

library(RDCOMClient)
folderName <- "AUX"
OutApp <- COMCreate("Outlook.Application")

However, when I try to use any method from OutApp, R crashes, regardless of whether I'm using console R or RStudio. For example:

outMail = OutApp$CreateItem(0)
outlookNameSpace = OutApp$GetNameSpace("MAPI")

Either of these code chunks cause R to encounter a fatal error and the session to be terminated. No errors/warnings along the way, just an immediate crash. str(OutApp) returns that OutApp is of formal class COMIDispatch [package "RDComClient"] with 1 slot (.. @ ref:). OutApp is of length 1 and mode S4.

Any suggestions?

Duck
  • 39,058
  • 13
  • 42
  • 84
  • https://github.com/omegahat/RDCOMClient/issues/24#issuecomment-654439280 You can choose which version of R to use by holding `ctrl` when opening R studio. R3.6 works for me – billash Aug 18 '20 at 20:27
  • 2
    See [RDCOMClient#26](omegahat/RDCOMClient), and a suggested workaround (for R-4) in https://github.com/omegahat/RDCOMClient/issues/24#issuecomment-654439280 (as @BillAsh just suggested). – r2evans Aug 18 '20 at 20:28
  • https://community.rstudio.com/t/rstudio-session-aborted-rdcomclient/66509 – Parfait Aug 18 '20 at 20:28
  • Follow-on link from BillAsh's link: https://stackoverflow.com/q/61735315/3358272 – r2evans Aug 18 '20 at 20:29

1 Answers1

4

A minimal commit was created by a helpful user, due to which the code in OP will work for R > 4.0.

Use the following installation:

library(remotes) 
remotes::install_github("BSchamberger/RDCOMClient", ref = "main")

More discussion at this link.

info_seekeR
  • 1,296
  • 1
  • 15
  • 33