Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Sheets2Slide/Code.gs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
Convert sheet row to a slide.
This works with a particular type of theme for this particular script.
*/

function pushToSlide(data){

var data = SpreadsheetApp.getActiveSheet().getDataRange().getValues();

var slideMain = SlidesApp.create('PRESENTATION NAME');
var slide = slideMain.insertSlide(0);

var mainImage = slide.insertImage(data[0][2], 75 , 10 , 200 , 125);

var line = slide.insertLine(SlidesApp.LineCategory.STRAIGHT, 75 , 110, 100 , 110)
var shape = slide.insertShape(SlidesApp.ShapeType.TEXT_BOX, 70, 135, 300, 30);
var textRange = shape.getText();
var text = textRange.setText(data[0][1]);
text.getTextStyle().setFontFamilyAndWeight('Roboto', 400).setFontSize(14);

var line = slide.insertLine(SlidesApp.LineCategory.STRAIGHT, 75 , 190, 100 , 190)
var shape = slide.insertShape(SlidesApp.ShapeType.TEXT_BOX, 70, 200, 300, 30);
var textRange = shape.getText();
var text = textRange.setText(data[0][3]);
text.getTextStyle().setFontFamilyAndWeight('Roboto', 100).setFontSize(10.5).setForegroundColor('#333333');

var cc = SpreadsheetApp.getActiveSheet().getCharts()[0];
slide.insertSheetsChart(cc, 425 , 50 , 250 , 250)

}
14 changes: 14 additions & 0 deletions Sheets2Slide/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[![Screenshot](screenshot.png)](screenshot.png)
----
## Open a sheet

### Fill the row in this structure

| COLUMN 1 | COUMN 2 | COLUMN 3 | COUMN 4 |
| ------ | ------ | ------ | ------ |
| FYI : slide ref | Main title | Main image/logo {URL} | A Paragraph |

If needed you can generate a chart in the same sheet (can be data from other sheet too).

Open SCript editor and paste the code from Code.gs file and hit Run.

Binary file added Sheets2Slide/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.