Hey there,
So If I understand correctly after some hours of researching, it’s not possible to embed other files into a spreadsheet or doc (yet?). We have a feature we want to build to tackle this as our customers want to be able to include attachments into their file. I found out that I can reuse the hyperlink functionality for this, as it represents an attachment in a sort of way. I add and link the hyperlink to the same cell (internal address). So far so good, I achieved it like this for spreadsheet case:
const addHyperlinkToRange = () => {
// @ts-ignore
window.connector.callCommand(() => {
// @ts-ignore
const sheet = Api.GetActiveSheet()
const sheetName = sheet.GetName()
const cellRange = sheet.GetSelection()
const address = cellRange.GetAddress()
sheet.SetHyperlink(address, '', `${sheetName}!${address}`, 'zambia_poi.shp', 'Included attachment')
})
}
Now I have some questions to proceed my feature:
- Is it possible to add multiple hyperlinks to 1 cell?
- Is it possible to have text AND a hyperlink (or multiple) in a cell?
- Is there a method called when a hyperlink is deleted so I can listen to that method and do some stuff on our end to delete the link with the attachment in our db? For this particular part I wanted to listen to onMethodReturn method you provide in your documentation, but I can’t seem to retrieve feedback in there, maybe I do something wrong?
- When I listen to onDocumentStateChange, I don’t get relevant info back about what happened, like if I could know they cleared a cell, I could check if it was a hyperlink or something?
We are using React in our frontend btw.
Would be nice to have some feedback about this, thanks in advance!