Reading and Scanning Ms Word .Doc Files in R

Automating Knitting a Word doc and emailing it with R

Yes, there is... at least definitely if you are sending from a gmail account.

I use library(emayili) to send emails from my code often.

I believe something like this might work for you:

  recipients <- c("email address 1", "email address 2")

email <- envelope() %>%
from("senders email account") %>%
to(recipients) %>%
subject("subject") %>%
text("body") %>% attachment("file name", path = "file path as saved onto your pc")

smtp <- server(host = "smtp.gmail.com",
port = 465,
username = "your email username",
password = "your email password")

smtp(email, verbose = TRUE)

I did notice that to actually attach the file, you need to have a body to the email as well. Not just the attachment.

That's the email part.

For the knitting part, try something like this

rmarkdown::render("AutomationPricingReport.Rmd", 
output_file = "AutomationPricingReport.docx"
)

As Jon Spring pointed out in the comments, library(taskscheduleR) is probably your best bet to automate running the script.

Appending MS Word DOC files with Perl programming

I think, you can try to solve your task with the Win32::Clipboard Perl module. That is the good start point. Additional information you can find here: http://www.perl.com/pub/2005/05/26/word_control.html.

Another module that can be useful for you is Win32::OLE. Small example of usage: http://www.adp-gmbh.ch/perl/word.html



Related Topics



Leave a reply



Submit