body_comment: Add comment in a 'Word' document

View source: R/docx_add.R

body_commentR Documentation

Add comment in a 'Word' document

Description

Add a comment at the cursor location. The comment is added on the first run of text in the current paragraph.

Usage

body_comment(x, cmt = ftext(""), author = "", date = "", initials = "")

Arguments

x

an rdocx object

cmt

a set of blocks to be used as comment content returned by function block_list().

author

comment author.

date

comment date

initials

comment initials

Examples

doc <- read_docx()
doc <- body_add_par(doc, "Paragraph")
doc <- body_comment(doc, block_list("This is a comment."))
docx_file <- print(doc, target = tempfile(fileext = ".docx"))
docx_comments(read_docx(docx_file))

officer documentation built on Oct. 10, 2024, 1:06 a.m.