Is there a way to insert MS Word computed field - total number of pages in the document - into a flextable table?
In the officer
package there's a function run_word_field
. I tried to use it the following way:
flextable(df) %>%
compose(value = as_paragraph(
as_chunk(run_word_field(field = "NumPages \\* MERGEFORMAT"))
))
but it throws an error.
Is there a workaround?
You can now use function
as_word_field
: