% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/docx_add.R
\name{body_add_list}
\alias{body_add_list}
\title{Add a list of items into a 'Word' document}
\usage{
body_add_list(x, items, pos = "after")
}
\arguments{
\item{x}{an rdocx object}

\item{items}{a \code{\link[=block_list_items]{block_list_items()}} object.}

\item{pos}{where to add the new element relative to the cursor,
one of "after", "before", "on".}
}
\description{
Add a bullet or numbered list produced by
\code{\link[=block_list_items]{block_list_items()}} into an rdocx object.
}
\examples{
library(officer)

items <- block_list_items(
  list_item(fpar(ftext("Item 1", fp_text(color = "red"))), level = 1),
  list_item(fpar("Sub-item"), level = 2),
  list_item(fpar("Item 2"), level = 1),
  list_type = "bullet"
)

doc <- read_docx()
doc <- body_add_list(doc, items = items)
print(doc, target = tempfile(fileext = ".docx"))
}
\seealso{
Other functions for adding content:
\code{\link[=body_add_blocks]{body_add_blocks()}},
\code{\link[=body_add_break]{body_add_break()}},
\code{\link[=body_add_caption]{body_add_caption()}},
\code{\link[=body_add_docx]{body_add_docx()}},
\code{\link[=body_add_fpar]{body_add_fpar()}},
\code{\link[=body_add_gg]{body_add_gg()}},
\code{\link[=body_add_img]{body_add_img()}},
\code{\link[=body_add_par]{body_add_par()}},
\code{\link[=body_add_plot]{body_add_plot()}},
\code{\link[=body_add_table]{body_add_table()}},
\code{\link[=body_add_toc]{body_add_toc()}},
\code{\link[=body_append_start_context]{body_append_start_context()}},
\code{\link[=body_import_docx]{body_import_docx()}}
}
\concept{functions for adding content}
