RDCOMClient: how to use enum objects or how to get their match values?
can be used to connect to COM objects on Windows. There are many enums in the MSDN link (e.g.
for blue, see here ) that match the meaning. They can be directly used in, for example, VBA code.
How can I work with enum objects using RDCOMClient? Is there, for example, a way to get the corresponding value for an enum from R? There is a function
, but I don't see how to use it for this purpose.
A small example
The following codes create a new Word document and write some text into it. The paragraph has been changed to right justification. An integer is used here
, which corresponds to the numbering
. I would like to be able to use, for example, a string
instead of a value
. Is there a way to do this using
x <- COMCreate("Word.Application") # create application x[["visible"]] <- TRUE x[["Documents"]]$Add() x[["Selection"]]$TypeText("hello") p <- x[["ActiveDocument"]][["Paragraphs"]]$Item(1) p[["Alignment"]] <- 2
source to share
No one has answered this question yet
Check out similar questions: