How to add an Outlook email signature to a COM object using RDCOMClient

I work RDCOMClient in some of my workflows and thanks to agstudy's answer Here I can send throuhg r emails, but I cannot figure out how to add my Outlook email signature. I am new to COM objects, but have done a fair amount of searching and haven’t found anything. Because my reputation has not hit 50 yet, I could not comment on it to ask. Can someone show me how I can add my Outlook signature email?

library(RDCOMClient)
OutApp <- COMCreate("Outlook.Application") 
outMail = OutApp$CreateItem(0)
outMail[["To"]] = "dest@dest.com"
outMail[["subject"]] = "some subject"
outMail[["body"]] = "some body"
## I want to add my outlook signature here.                     
outMail$Send()
+5
source share
2 answers

Outlook GetInspector(). , , , :

library(RDCOMClient)

olMailItem = 0
OutApp <- COMCreate("Outlook.Application")
outMail <- OutApp$CreateItem(olMailItem)

outMail$GetInspector()
signature = outMail[["HTMLBody"]]

outMail[["Recipients"]]$Add("dest@dest.com")
outMail[["Subject"]] = "some subject"
outMail[["HTMLBody"]] = paste0('<p>some body', signature, '</p>')

outMail$Display()
outMail <- NULL
OutApp <- NULL
+7

. , ( FECT 2 ,

0

Source: https://habr.com/ru/post/1658806/


All Articles