I am aware of a potential shell/vbs script solution.
However, I am seeking a solution with the library(RDCOMClient)
package.
I looked into:
Some attempts from me (given a Public Sub dss()
in ThisOutlookSession
) in Outlook:
library(RDCOMClient)
> OutApp <- COMCreate("Outlook.Application")
> oa<-OutApp[["Session"]][["Accounts"]]
> OutApp$dss()
Error in .COM(x, name, ...) :
Cannot locate 0 name(s) dss in COM object (status = -2147352570)
> OutApp$Application$dss()
Error in OutApp$Application$dss :
object of type 'closure' is not subsettable
> OutApp$Run("dss")
Error in .COM(x, name, ...) :
Cannot locate 0 name(s) Run in COM object (status = -2147352570)
Macro could be simply:
Public Sub dss()
Dim excApp As Object
Dim excWkb As Object
Dim excWks As Object
Set excApp = CreateObject("Excel.Application")
Set excWkb = excApp.Workbooks.Add()
excWkb.SaveAs "AXX.xlsx"
excWkb.Close
End Sub