Skip to content

feat: insert hyperlink in paragraph #1156

Open
@emadyounan

Description

@emadyounan

Good evening,

I have two document files and I need to make the first document file hyperlink to the other one from the text I extracted from the table cell

wordDoc = Document(r'testfile.docx')

for table in wordDoc.tables:
    for row in table.rows:
        for cell in row.cells:
            if cell.text == "page" or cell.text == "subject":
                pass
            else:
                if cell.text.isdigit():
                   # i need to add hyperlink to this cell text to that file
                   # cell text will be like 3
                    add_hyperlink(cell.text, "test2.docx#3")
                    wordDoc.save('demo.docx')

Metadata

Metadata

Assignees

No one assigned

    Labels

    hyperlinkRead and write hyperlinks in paragraph

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions