I have a column of URL(it's the column 10 - J) of Google Docs in my Spreadsheet and I did a script so that if I click on a cell in the document it will recuperate the row the column is constant = 10 via a bouton and will launch the document in a text box:
var TITLE = 'Sidebar Title';
COLUMN_URL = 10;
function showHandle() {
var link = SpreadsheetApp.getActiveSheet().getRange(SpreadsheetApp.getActiveRange().getRowIndex(),COLUMN_URL).getValue();
Logger.log('The URL is : ' + link );
var body = DocumentApp.openByUrl(link).getBody();
Logger.log('The body is ' + body );
var ui = HtmlService.createTemplateFromFile('ModeLessDialog')
.evaluate()
.setWidth(1000)
.setHeight(500);
SpreadsheetApp.getUi().showModalDialog(ui, TITLE);
}
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<iframe src= "link + ' '" height="1000" width="90%"></iframe>
</body>
</html>
In fact I want to pass in the src -> the URL here
SpreadsheetApp.getActiveSheet().getRange(SpreadsheetApp.getActiveRange().getRowIndex(),COLUMN_URL).getValue() but it does't recognize it
.I don't know how to integrate in the src in the logs the link is shown correctly if i put directly the url of the cell it works but i have 70 rows that corresponds to a Google doc.If you have an idea thank you very much.