google-docs

Accessing Google Docs Metadata feed with gdata-objectivec-client

北慕城南 提交于 2019-12-13 03:04:06
问题 What's the simplest why to access/parse Google Docs Metadata feed with gdata-objectivec-client? 回答1: Somehow I overlooked this from the example: GDataServiceGoogleDocs *service = [self docsService]; NSURL *entryURL = [GDataServiceGoogleDocs metadataEntryURLForUserID:kGDataServiceDefaultUser]; GDataServiceTicket *ticket; ticket = [service fetchEntryWithURL:entryURL delegate:self didFinishSelector:@selector(metadataFeedTicket:finishedWithEntry:error:)]; 来源: https://stackoverflow.com/questions

Add custom menu to a Google Document

纵然是瞬间 提交于 2019-12-13 03:02:08
问题 I'm discovering Google App Script and I'm very attracted by its potential. I want to improve a Google Document by adding a custom menu. I found many how-to to make this in a spreadsheet but nothing for document. Did I miss anything ? 回答1: From: https://developers.google.com/apps-script/reference/document/document-app#getActiveDocument() // Add a custom menu to the active document, including a separator and a sub-menu. function onOpen() { DocumentApp.getUi() .createMenu('My Menu') .addItem('My

Change Header Margin with Google Docs API

柔情痞子 提交于 2019-12-13 02:55:18
问题 I want to add an image to the Header of a Google Document that will occupy the whole space inside the header (without any empty white spaces on either side of the image). By default, there is indentation/margin on 3 sides of the header (top, left and right). I have successfully removed left and right margin/indentation by setting indentStart , indentFirstLine and indentEnd to 0 . Unfortunately, I cannot remove the blank space on the top of the header! For reference: If you want to adjust the

Replace image with table in google doc

寵の児 提交于 2019-12-13 00:54:44
问题 I want to replace a selected image with a table containing that image in a Google Doc. No table is inserted into the google doc when I run the code. function insertImage(ID, caption) { var selection = DocumentApp.getActiveDocument().getSelection(); if (selection) { var elements = selection.getSelectedElements(); var tImg = elements[0].getElement(); var cells = [ [tImg.asInlineImage(), ID+': '+caption] ]; var parentElement = tImg.getParent(); parentElement.insertTable(parentElement

Display full length of document for embed google document

自作多情 提交于 2019-12-13 00:27:29
问题 How can I display the full length of an embedded google document without the scroll bar on the iframe? <html> <style> body { margin: 0; padding: 0; o} iframe { margin-left: 2vw; margin-top: 2vh; height: 100%; width: 90vw; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <body> <iframe srcdoc="" frameborder="0" scrolling="no" height="100%"></iframe> <script> $(function() { $.get("https://docs.google.com/document/d/17OkIgtNdV1flno

Google Drive SDK docid changed - How to relate documents stored by old docid to the new one?

谁说胖子不能爱 提交于 2019-12-13 00:13:59
问题 It appear that the docid's changed for all google drive documents on our google apps domain... Will it change again? Why was it changed? (my google/yahoo/bing searches on this subject turn up nothing useful - is no one else experiencing this? For me it seems to have happened at around Jan 16/17th) And most importantly for now: Is there a way to cross-reference all of the old docid's to the corresponding new docid's? 回答1: Found out some more info. The root cause is a migration from the old

Fail to upload a image file into Google Doc via java api

故事扮演 提交于 2019-12-13 00:11:53
问题 below is my code DocsService client = new DocsService("testappv1"); client.setUserCredentials(username, password); client.setProtocolVersion(DocsService.Versions.V2); File file = new File("C:/test.jpg"); DocumentEntry newDocument = new DocumentEntry(); newDocument.setTitle(new PlainTextConstruct("test")); String mimeType = DocumentListEntry.MediaType.fromFileName(file.getName()).getMimeType(); newDocument.setMediaSource(new MediaFileSource(file, mimeType)); newDocument = client.insert

google.script.run not returning string

丶灬走出姿态 提交于 2019-12-12 21:14:44
问题 Trying to figure out Google Apps Script for making Google docs addons. I have: Code.gs function helloWorld() { return "Hello World"; } under code.gs which I call in: Sidebar.html console.log("This should say Hello World: " + google.script.run.helloWorld()) It returns: This should say Hello World: undefined What is the obvious thing I am missing? 回答1: google.script.run won't return a value like you'd expect a usual Apps Script function to. Instead, you should use .withSuccessHandler

how to pass parameters to a triggered function in google-app-script

早过忘川 提交于 2019-12-12 18:18:49
问题 I have a array of recipients and a scheduled time at which the mail has to be sent. I am eager in knowing if there is someway to create a trigger to which i can pass these params(recipients) function send_mail(recipients) { var id = DocumentApp.getActiveDocument().getId(); for(i=0;i<recipients.length;i++) { var url = "https://docs.google.com/feeds/download/documents/export/Export?id="+id+"&exportFormat=html"; var param = { method : "get", headers : {"Authorization": "Bearer " + ScriptApp

Getting data from Google docs into Javascript

拈花ヽ惹草 提交于 2019-12-12 17:29:05
问题 I try to get data from google spreadsheets and everything is allright when I'm testing html page locally. But when I load my html file and javascript file into server nothing works. Here is the code of html file "page.htm": <html> <head> <title> </title> <script type="text/javascript" src="teams.js" > </script> </head> <body onload= "Data();"> <table> <form name="Team"> <tr> <td> <input size="19" name="tName" readonly > </td> </tr> </form> </table> </body> </html> And js file "teams.js":