google-docs

How can you sort data validation input list in google spreadsheet

会有一股神秘感。 提交于 2021-02-08 20:52:37
问题 Given the following data validation setup I can only select foods in the way I entered them in the list of foods column. Is there a way to sort these before I'm able to select those? 回答1: You could use a PivotTable to help you: Select the field containing the list and go to 'Data' > 'Pivot table report...' Click 'Add field' for 'Rows' and pick the field in the dropdown. Ensure that the order is ascending, that the 'Show totals' is unchecked (or else, you'll get 'Grand Total' in your

How can you sort data validation input list in google spreadsheet

六月ゝ 毕业季﹏ 提交于 2021-02-08 20:52:11
问题 Given the following data validation setup I can only select foods in the way I entered them in the list of foods column. Is there a way to sort these before I'm able to select those? 回答1: You could use a PivotTable to help you: Select the field containing the list and go to 'Data' > 'Pivot table report...' Click 'Add field' for 'Rows' and pick the field in the dropdown. Ensure that the order is ascending, that the 'Show totals' is unchecked (or else, you'll get 'Grand Total' in your

How to set first line of paragraph HEADING2 and rest normal text

烂漫一生 提交于 2021-02-08 11:21:59
问题 I'm using Google Apps Script to iterate through my contacts and print name, address, email and phone numbers to a document. I want the name in style "Heading 2" and the rest in style "Normal text". How can I do this? Here's what I've got so far but it makes the whole paragraph Heading 2, instead of just the name. var myContacts = ContactsApp.findContactGroup('Some group').getContacts(); for (i=0; i < myContacts.length; i++) { var fullName = myContacts[i].getFullName(); if (fullName == '')

How to change only the *selected* text to uppercase, not the entire paragraph in which the selection exists

℡╲_俬逩灬. 提交于 2021-02-08 08:25:23
问题 In Google docs, this function changes the selected text to black function selectedFontColorBlack() { // DocumentApp.getUi().alert('selectedFontColorBlack'); var sel = DocumentApp.getActiveDocument().getSelection(); var elements = sel.getRangeElements(); for (var i = 0; i < elements.length; i++) { var element = elements[i]; // Only modify elements that can be edited as text; skip images and other non-text elements. if(element.getElement().editAsText) { var text = element.getElement()

How to change only the *selected* text to uppercase, not the entire paragraph in which the selection exists

喜欢而已 提交于 2021-02-08 08:24:05
问题 In Google docs, this function changes the selected text to black function selectedFontColorBlack() { // DocumentApp.getUi().alert('selectedFontColorBlack'); var sel = DocumentApp.getActiveDocument().getSelection(); var elements = sel.getRangeElements(); for (var i = 0; i < elements.length; i++) { var element = elements[i]; // Only modify elements that can be edited as text; skip images and other non-text elements. if(element.getElement().editAsText) { var text = element.getElement()

Lock script execution on a document when script is deployed as web app

拥有回忆 提交于 2021-02-08 07:32:07
问题 My Google Apps Script is deployed as web app and can be accessed by any user. Its functionality is to open and change the text in that document. I send the script a document ID as a query parameters like so: https://script.google.com/a/macros/s/AKfycbzCP...TnwHUbXxzDM/exec?docId=1_cMN0nuJadBw6QVjKtdEA6eXhE8ubIoxIJai1ticxnE` Web app opens the document and changes the text in the document. function doGet(e){ var params=e.parameters; var doc = DocumentApp.openById(params['docId']); ... /* change

Accessing comments in Google Documents

若如初见. 提交于 2021-02-08 05:28:59
问题 I am being unable to figure out how to access comments in Google documents using Google Apps Scripts. Looking at the API reference, I found only the CommentSection class, but that is marked deprecated. Looking for some help. Thanks. Sanjay 回答1: Unfortunately it's not currently possible to access the document's comments using Google Apps Script. You can file a feature request for this on the issue tracker. 回答2: Following the initial discussion in this post I've managed to get the comments in a

Google Docs simulate keyboard

安稳与你 提交于 2021-02-07 18:27:26
问题 I need to simulate keyboard in google docs with using JavaScript to be able print or erase characters on cursor position. Unfortunately solutions with simulating keypress event didn't work for me. I tried with and without jQuery. After some investigation I detected that Google Docs have virtual keyboard. Clicks on virtual keys calls this function: C.MOa = function(a) { this.dispatchEvent(new Q(Td, {keyCode: a})) }; Where Td is a string "action" and Q some Event class. What is the correct way

Google Docs simulate keyboard

╄→尐↘猪︶ㄣ 提交于 2021-02-07 18:27:24
问题 I need to simulate keyboard in google docs with using JavaScript to be able print or erase characters on cursor position. Unfortunately solutions with simulating keypress event didn't work for me. I tried with and without jQuery. After some investigation I detected that Google Docs have virtual keyboard. Clicks on virtual keys calls this function: C.MOa = function(a) { this.dispatchEvent(new Q(Td, {keyCode: a})) }; Where Td is a string "action" and Q some Event class. What is the correct way

How to copy ListItems from one Google Document to another while preserving numbering?

匆匆过客 提交于 2021-02-07 10:31:11
问题 The accepted answer to How to copy content and formatting between Google Docs? indicates that we have to add conditional code just to copy elements. But I cannot get it to work for ListItem types, because the target document shows the list items without the original numbering. var source_doc = DocumentApp.getActiveDocument(); var selection = source_doc.getSelection(); if (!selection) { var ui = DocumentApp.getUi(); ui.alert('Please make a selection first.'); return; } var target_doc =