Ziv-Barber/officegen

How to insert a link into Node.js officegen table

Opened this issue · 1 comments

The following code generates a table in officegen, If you provide a raw string to val prop inside the table it generates the text, but how would you provide link?

Tried with creating a paragraph and enhancing it to a link but to no avail.

let pObj = docx.createP();
linkObj = pObj.addText('link', { link: 'http://www.google.com' });

const titleCell = (cellValue) => ({
        val: cellValue,
        opts: {
            cellColWidth: 2500,
            b: true,
            sz: '12',
            fontFamily: 'Times New Roman'
        }
    })

 const table = [
        [titleCell('name'), titleCell(linkObj)],
 ]

See stack-overflow question: https://stackoverflow.com/questions/62522872/how-to-insert-a-link-into-node-js-officegen-table