我正在用pptx python创建一个报告。 我正在尝试向其中一个表格单元格添加超链接。 有人知道我怎么做吗? 这是我的代码:
prs = Presentation()
prs.slide_width = Inches(16)
prs.slide_height = Inches(9)
title_only_slide_layout = prs.slide_layouts[6]
slide = prs.slides.add_slide(title_only_slide_layout)
shapes = slide.shapes
rows = 2
cols = 1
left = Inches(0.5)
top = Inches(1.5)
width = Inches(15)
height = Inches(0.8)
table = shapes.add_table(rows, cols, left, top, width, height).table
table.cell(0,0).text = 'title'
table.cell(1,0).text = 'link'
我希望链接文本是超链接。 我将感谢您的帮助:)
添加超链接有点棘手。您首先需要在文本中添加“run”,添加要显示的文本,然后添加超链接地址。例如:
相关问题 更多 >
编程相关推荐