View source: R/ooxml_run_objects.R
run_comment | R Documentation |
Add a comment on a run object.
run_comment(
cmt,
run = ftext(""),
author = "",
date = "",
initials = "",
prop = NULL
)
cmt |
a set of blocks to be used as comment content returned by
function |
run |
a run object, made with a call to one of |
author |
comment author. |
date |
comment date |
initials |
comment initials |
prop |
formatting text properties returned by
|
Other run functions for reporting:
external_img()
,
ftext()
,
hyperlink_ftext()
,
run_autonum()
,
run_bookmark()
,
run_columnbreak()
,
run_footnote()
,
run_footnoteref()
,
run_linebreak()
,
run_pagebreak()
,
run_reference()
,
run_tab()
,
run_word_field()
,
run_wordtext()
fp_bold <- fp_text_lite(bold = TRUE)
fp_red <- fp_text_lite(color = "red")
bl <- block_list(
fpar(ftext("Comment multiple words.", fp_bold)),
fpar(
ftext("Second line.", fp_red)
)
)
comment1 <- run_comment(
cmt = bl,
run = ftext("with a comment"),
author = "Author Me",
date = Sys.Date(),
initials = "AM"
)
par1 <- fpar("A paragraph ", comment1)
bl <- block_list(
fpar(ftext("Comment a paragraph."))
)
comment2 <- run_comment(
cmt = bl, run = ftext("A commented paragraph"),
author = "Author You",
date = Sys.Date(),
initials = "AY"
)
par2 <- fpar(comment2)
doc <- read_docx()
doc <- body_add_fpar(doc, value = par1, style = "Normal")
doc <- body_add_fpar(doc, value = par2, style = "Normal")
print(doc, target = tempfile(fileext = ".docx"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.