2011-10-26 39 views

cevap

8

: Eğer bir resim yükleyebilir eğer

function insertImage() { 
    // Retrieve an image from the web. 
    var resp = UrlFetchApp.fetch("http://www.google.com/intl/en_com/images/srpr/logo2w.png"); 

    // Create a document. 
    var doc = DocumentApp.openById(""); 

    // Append the image to the first paragraph. 
    doc.getChild(0).asParagraph().appendInlineImage(resp.getBlob()); 
} 

http://code.google.com/googleapps/appsscript/class_documentapp_listitem.html#appendInlineImage

emin değilim. Ancak, bunu bir URL aracılığıyla bir Paragraf'a yerleştirebilirsiniz.

+0

Bunu görmedim. Teşekkürler! – ehfeng

+0

Bunu bir PNG ile yapabildim, ancak bazı nedenlerle JPEG değil. Bunun için bir hata raporu aldım. – Fred

+0

@Frederic - Tüm formatlarla çalışmasını sağlarım. bakınız [örnek burada] (http://stackoverflow.com/questions/15461170/upload-an-image-to-a-google-spreadsheet/15474002#15474002) –

İlgili konular