Search code examples
officer

Combine tables and text in powerpoint


I would like to combine text and tables in the same shape on a slide. For example I want to add text above a table, the table, then text below. What I would like to do is have the ph_with_text and ph_with_table functions below append their str and value to the body shape:

library("officer")
d = read_pptx()
d = add_slide(d,  layout="Title and Content", master="Office Theme")
d = ph_with_text(x=d,  type  = "body", str   = 'Text Above')
d = ph_with_table(x=d, type  = "body", value = mt)
d = ph_with_text(x=d,  type  = "body", str   = 'Text Below')
print(d, target="test_officer.pptx")

Solution

  • I am afraid this is not an option. You can not combine text and tables within a PowerPoint placeholder, that is a MS PowerPoint's limit, not an officer's limit.