2011-10-26 3 views

답변

8

: 당신은 이미지를 업로드 할 수있는 경우

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

잘 모르겠어요. 하지만 URL을 통해 단락에 삽입 할 수 있습니다.

+0

이 부분을 보지 못했습니다. 감사! – ehfeng

+0

나는 이것을 PNG로 할 수 있었지만 어떤 이유로 JPEG를 할 수 없었다. 나는 그것에 대한 버그 보고서를 제출했다. – Fred

+0

@Frederic - 모든 형식에서 작동하도록했습니다. [example here] (http://stackoverflow.com/questions/15461170/upload-an-image-to-a-google-spreadsheet/15474002#15474002) –

관련 문제