function exportSelectedCellsAndHeadersToDocument() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getActiveSheet();
const range = sheet.getActiveRange();
const data = range.getValues();
const headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
const doc = DocumentApp.create('Export');
const body = doc.getBody();
Logger.log(headers);
for (let i = 0; i < data.length; i++) {
for (let j = 0; j < data[i].length; j++) {
body.appendParagraph(`${headers[j]} : ${data[i][j]}` + '\t');
}
}
}