Class ListItem

ListItem

लिस्ट आइटम को दिखाने वाला एलिमेंट. ListItem एक Paragraph है जो जुड़ा हुआ है चुनें. ListItem में Equation, Footnote, HorizontalRule, InlineDrawing, InlineImage, PageBreak, और Text शामिल हो सकते हैं एलिमेंट. दस्तावेज़ की बनावट के बारे में ज़्यादा जानकारी के लिए, Google Docs के दस्तावेज़ को बड़ा करने के लिए गाइड देखें.

ListItems में नए-नए वर्ण नहीं हो सकते. नई पंक्ति के वर्ण ("\n") लाइन-ब्रेक वर्णों ("\r") में बदला गया.

एक ही सूची आईडी वाली ListItems एक ही सूची से संबंधित हैं और उन्हें उसी हिसाब से नंबर दिया गया है. किसी दी गई सूची के लिए ListItems को टैब के आस-पास होने की आवश्यकता नहीं है या यहां तक कि वही पैरंट एलिमेंट. एक ही सूची से संबंधित दो आइटम टैब में कहीं भी मौजूद हो सकते हैं जबकि क्रम संख्या को बनाए रखना, जैसा कि नीचे दिए गए उदाहरण में दिखाया गया है:

var body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Append a new list item to the body.
var item1 = body.appendListItem('Item 1');

// Log the new list item's list ID.
Logger.log(item1.getListId());

// Append a table after the list item.
body.appendTable([
  ['Cell 1', 'Cell 2']
]);

// Append a second list item with the same list ID. The two items are treated as the same list,
// despite not being consecutive.
var item2 = body.appendListItem('Item 2');
item2.setListId(item1);

तरीके

तरीकारिटर्न टाइपसंक्षिप्त विवरण
addPositionedImage(image)PositionedImageतय की गई इमेज ब्लॉब से एक नया PositionedImage बनाता है और उसे शामिल करता है.
appendHorizontalRule()HorizontalRuleनया HorizontalRule बनाता और जोड़ता है.
appendInlineImage(image)InlineImageयह तय किए गए इमेज ब्लॉब से एक नया InlineImage बनाता और जोड़ता है.
appendInlineImage(image)InlineImageदिए गए InlineImage को जोड़ता है.
appendPageBreak()PageBreakनया PageBreak बनाता और जोड़ता है.
appendPageBreak(pageBreak)PageBreakदिए गए PageBreak को जोड़ता है.
appendText(text)Textबताई गई सामग्री के साथ नया Text एलिमेंट बनाता और जोड़ता है.
appendText(text)Textदिए गए Text एलिमेंट को जोड़ता है.
clear()ListItemएलिमेंट के कॉन्टेंट को हटाता है.
copy()ListItemमौजूदा एलिमेंट की अलग की गई, डीप कॉपी दिखाता है.
editAsText()Textबदलाव करने के लिए, मौजूदा एलिमेंट का Text वर्शन हासिल करता है.
findElement(elementType)RangeElementबताए गए टाइप के डिसेंडेंट के लिए एलिमेंट की सामग्री खोजता है.
findElement(elementType, from)RangeElementचुने गए टाइप के डिसेंडेंट के लिए एलिमेंट की सामग्री खोजता है, जिसकी शुरुआत RangeElement बताया गया.
findText(searchPattern)RangeElementरेगुलर एक्सप्रेशन का इस्तेमाल करके, तय किए गए टेक्स्ट पैटर्न के एलिमेंट के कॉन्टेंट की खोज करता है.
findText(searchPattern, from)RangeElementदिए गए टेक्स्ट पैटर्न के लिए, एलिमेंट के कॉन्टेंट की खोज करता है. इसकी शुरुआत, दिए गए टेक्स्ट से होती है खोज के नतीजे.
getAlignment()HorizontalAlignmentHorizontalAlignment को वापस लाता है.
getAttributes()Objectएलिमेंट के एट्रिब्यूट हासिल करता है.
getChild(childIndex)Elementबताए गए चाइल्ड इंडेक्स में चाइल्ड एलीमेंट को हासिल करता है.
getChildIndex(child)Integerबताए गए चाइल्ड एलिमेंट के लिए चाइल्ड इंडेक्स फिर से लाता है.
getGlyphType()GlyphTypeसूची आइटम के GlyphType को फिर से हासिल करता है.
getHeading()ParagraphHeadingParagraphHeading को वापस लाता है.
getIndentEnd()Numberपॉइंट में आखिरी इंडेंट वापस लाता है.
getIndentFirstLine()Numberपॉइंट के हिसाब से, पहली लाइन का इंडेंट वापस लेता है.
getIndentStart()Numberशुरुआती इंडेंटेशन वापस लाता है.
getLineSpacing()Numberलाइनों के बीच की दूरी को पॉइंट में दिखाता है.
getLinkUrl()Stringलिंक के यूआरएल को वापस लाता है.
getListId()Stringसूची आईडी की जानकारी लेता है.
getNestingLevel()Integerसूची आइटम के नेस्टिंग स्तर को फिर से प्राप्त करता है.
getNextSibling()Elementयह एलिमेंट का अगला सिबलिंग एलिमेंट हासिल करता है.
getNumChildren()Integerबच्चों की संख्या की जानकारी देता है.
getParent()ContainerElementएलिमेंट के पैरंट एलिमेंट को हासिल करता है.
getPositionedImage(id)PositionedImageइमेज के आईडी के हिसाब से PositionedImage मिलता है.
getPositionedImages()PositionedImage[]पैराग्राफ़ के साथ ऐंकर किए गए सभी PositionedImage ऑब्जेक्ट को शामिल करता है.
getPreviousSibling()Elementयह एलिमेंट के पिछले सिबलिंग एलिमेंट को हासिल करता है.
getSpacingAfter()Numberएलिमेंट के बाद, पॉइंट में स्पेस को हासिल करता है.
getSpacingBefore()Numberएलिमेंट के पहले की दूरी को पॉइंट में हासिल करता है.
getText()Stringएलिमेंट के कॉन्टेंट को टेक्स्ट स्ट्रिंग के तौर पर वापस लाता है.
getTextAlignment()TextAlignmentइससे टेक्स्ट अलाइनमेंट की सुविधा मिलती है.
getType()ElementTypeएलिमेंट के ElementType को हासिल करता है.
insertHorizontalRule(childIndex)HorizontalRuleतय किए गए इंडेक्स में HorizontalRule बनाता है और उसे शामिल करता है.
insertInlineImage(childIndex, image)InlineImageतय किए गए इमेज ब्लॉब से, एक नया InlineImage बनाता है और उसे शामिल करता है इंडेक्स करें.
insertInlineImage(childIndex, image)InlineImageदिए गए InlineImage को तय इंडेक्स में शामिल करता है.
insertPageBreak(childIndex)PageBreakतय किए गए इंडेक्स में नया PageBreak बनाता है और उसे शामिल करता है.
insertPageBreak(childIndex, pageBreak)PageBreakदिए गए PageBreak को तय इंडेक्स में शामिल करता है.
insertText(childIndex, text)Textतय इंडेक्स में नया टेक्स्ट एलिमेंट बनाता और जोड़ता है.
insertText(childIndex, text)Textदिए गए Text एलिमेंट को तय इंडेक्स में, बताए गए टेक्स्ट के साथ शामिल करता है कॉन्टेंट.
isAtDocumentEnd()Booleanयह तय करता है कि एलिमेंट, Document के आखिर में है या नहीं.
isLeftToRight()Booleanबाएं-से-दाएं सेटिंग फिर से लाता है.
merge()ListItemयह एलिमेंट को एक ही टाइप के पिछले सिबलिंग के साथ मर्ज करता है.
removeChild(child)ListItemबताए गए चाइल्ड एलिमेंट को हटाता है.
removeFromParent()ListItemएलिमेंट को इसकी पैरंट जगह से हटाता है.
removePositionedImage(id)Booleanइमेज के आईडी से PositionedImage को हटाता है.
replaceText(searchPattern, replacement)Elementसामान्य का उपयोग करके, दिए गए बदले हुए स्ट्रिंग से दिए गए लेख पैटर्न की सभी आवृत्तियां बदलता है एक्सप्रेशन के बारे में भी बताया गया है.
setAlignment(alignment)ListItemHorizontalAlignment को सेट करता है.
setAttributes(attributes)ListItemएलिमेंट के एट्रिब्यूट सेट करता है.
setGlyphType(glyphType)ListItemसूची आइटम के GlyphType को सेट करता है.
setHeading(heading)ListItemParagraphHeading को सेट करता है.
setIndentEnd(indentEnd)ListItemबिंदुओं में समाप्ति इंडेंट सेट करता है.
setIndentFirstLine(indentFirstLine)ListItemपहली लाइन का इंडेंट, पॉइंट में सेट करता है.
setIndentStart(indentStart)ListItemपॉइंट के हिसाब से शुरुआती इंडेंट सेट करता है.
setLeftToRight(leftToRight)ListItemबाएं-से-दाएं सेटिंग को सेट करता है.
setLineSpacing(multiplier)ListItemलाइन के बीच की दूरी को संख्या के तौर पर सेट करता है. इससे पता चलता है कि स्पेसिंग के लिए लाइनों की संख्या कितनी है.
setLinkUrl(url)ListItemलिंक का यूआरएल सेट करता है.
setListId(listItem)ListItemसूची आईडी सेट करता है.
setNestingLevel(nestingLevel)ListItemसूची आइटम का नेस्टिंग स्तर सेट करता है.
setSpacingAfter(spacingAfter)ListItemएलिमेंट के बाद, पॉइंट में स्पेस सेट करता है.
setSpacingBefore(spacingBefore)ListItemएलिमेंट के पहले की स्पेस को पॉइंट में सेट करता है.
setText(text)voidसूची के आइटम के कॉन्टेंट को टेक्स्ट के तौर पर सेट करता है.
setTextAlignment(textAlignment)ListItemटेक्स्ट अलाइनमेंट सेट करता है.

विस्तृत दस्तावेज़

addPositionedImage(image)

तय की गई इमेज ब्लॉब से एक नया PositionedImage बनाता है और उसे शामिल करता है.

पैरामीटर

नामटाइपब्यौरा
imageBlobSourceइमेज का डेटा

वापसी का टिकट

PositionedImage — नई जगह पर दिखाने वाली इमेज

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

appendHorizontalRule()

नया HorizontalRule बनाता और जोड़ता है.

वापसी का टिकट

HorizontalRule — नया हॉरिज़ॉन्टल नियम

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

appendInlineImage(image)

यह तय किए गए इमेज ब्लॉब से एक नया InlineImage बनाता और जोड़ता है.

पैरामीटर

नामटाइपब्यौरा
imageBlobSourceइमेज का डेटा

वापसी का टिकट

InlineImage — जोड़ी गई इमेज

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

appendInlineImage(image)

दिए गए InlineImage को जोड़ता है.

पैरामीटर

नामटाइपब्यौरा
imageInlineImageइमेज का डेटा

वापसी का टिकट

InlineImage — जोड़ी गई इमेज

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

appendPageBreak()

नया PageBreak बनाता और जोड़ता है.

ध्यान दें: हो सकता है कि PageBreaks, TableCells में शामिल न हो. अगर मौजूदा एलिमेंट किसी टेबल सेल में है, तो अपवाद दिखेगा.

वापसी का टिकट

PageBreak — नया पेज ब्रेक एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

appendPageBreak(pageBreak)

दिए गए PageBreak को जोड़ता है.

ध्यान दें: हो सकता है कि PageBreaks, TableCells में शामिल न हो. अगर मौजूदा एलिमेंट किसी टेबल सेल में है, तो अपवाद दिखेगा.

पैरामीटर

नामटाइपब्यौरा
pageBreakPageBreakजोड़ने के लिए पेज ब्रेक

वापसी का टिकट

PageBreak — जोड़ा गया पेज ब्रेक एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

appendText(text)

बताई गई सामग्री के साथ नया Text एलिमेंट बनाता और जोड़ता है.

पैरामीटर

नामटाइपब्यौरा
textStringटेक्स्ट का कॉन्टेंट

वापसी का टिकट

Text — नया टेक्स्ट एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

appendText(text)

दिए गए Text एलिमेंट को जोड़ता है.

पैरामीटर

नामटाइपब्यौरा
textTextजोड़ने के लिए टेक्स्ट एलिमेंट

वापसी का टिकट

Text — जोड़ा गया टेक्स्ट एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

clear()

एलिमेंट के कॉन्टेंट को हटाता है.

वापसी का टिकट

ListItem — मौजूदा एलिमेंट.


copy()

मौजूदा एलिमेंट की अलग की गई, डीप कॉपी दिखाता है.

एलिमेंट में मौजूद सभी चाइल्ड एलिमेंट भी कॉपी कर लिए जाते हैं. नए एलिमेंट में यह मौजूद नहीं है पैरंट.

वापसी का टिकट

ListItem — नई कॉपी.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

editAsText()

बदलाव करने के लिए, मौजूदा एलिमेंट का Text वर्शन हासिल करता है.

एलिमेंट के कॉन्टेंट में रिच टेक्स्ट के तौर पर बदलाव करने के लिए, editAsText का इस्तेमाल करें. editAsText मोड बिना टेक्स्ट वाले एलिमेंट को अनदेखा कर देता है (जैसे कि InlineImage और HorizontalRule).

मिटाई गई टेक्स्ट रेंज में पूरी तरह से मौजूद चाइल्ड एलिमेंट, एलिमेंट से हटा दिए जाते हैं.

var body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Insert two paragraphs separated by a paragraph containing an
// horizontal rule.
body.insertParagraph(0, "An editAsText sample.");
body.insertHorizontalRule(0);
body.insertParagraph(0, "An example.");

// Delete " sample.\n\n An" removing the horizontal rule in the process.
body.editAsText().deleteText(14, 25);

वापसी का टिकट

Text — मौजूदा एलिमेंट का टेक्स्ट वर्शन


findElement(elementType)

बताए गए टाइप के डिसेंडेंट के लिए एलिमेंट की सामग्री खोजता है.

पैरामीटर

नामटाइपब्यौरा
elementTypeElementTypeखोजने के लिए एलिमेंट का टाइप.

वापसी का टिकट

RangeElement — खोज के नतीजे में, खोज एलिमेंट की पोज़िशन के बारे में बताया जाता है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

findElement(elementType, from)

चुने गए टाइप के डिसेंडेंट के लिए एलिमेंट की सामग्री खोजता है, जिसकी शुरुआत RangeElement बताया गया.

var body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Define the search parameters.
var searchType = DocumentApp.ElementType.PARAGRAPH;
var searchHeading = DocumentApp.ParagraphHeading.HEADING1;
var searchResult = null;

// Search until the paragraph is found.
while (searchResult = body.findElement(searchType, searchResult)) {
  var par = searchResult.getElement().asParagraph();
  if (par.getHeading() == searchHeading) {
    // Found one, update and stop.
    par.setText('This is the first header.');
    return;
  }
}

पैरामीटर

नामटाइपब्यौरा
elementTypeElementTypeखोजने के लिए एलिमेंट का टाइप.
fromRangeElementवह खोज नतीजा जिससे खोजना है.

वापसी का टिकट

RangeElement — खोज का नतीजा, जो खोज एलिमेंट की अगली पोज़िशन दिखाता है.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

findText(searchPattern)

रेगुलर एक्सप्रेशन का इस्तेमाल करके, तय किए गए टेक्स्ट पैटर्न के एलिमेंट के कॉन्टेंट की खोज करता है.

JavaScript रेगुलर एक्सप्रेशन सुविधाओं का एक सबसेट पूरी तरह से काम नहीं करता, जैसे कि कैप्चर ग्रुप और मोड मॉडिफ़ायर.

दिया गया रेगुलर एक्सप्रेशन पैटर्न, हर टेक्स्ट ब्लॉक से अलग से मैच किया जाता है जो मौजूदा एलिमेंट में शामिल हों.

पैरामीटर

नामटाइपब्यौरा
searchPatternStringखोजने के लिए पैटर्न

वापसी का टिकट

RangeElement — खोज के नतीजे से यह पता चलता है कि खोज के टेक्स्ट की जगह क्या है या अगर कोई टेक्स्ट मौजूद नहीं है, तो यह जानकारी शून्य होती है मिलान

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

findText(searchPattern, from)

दिए गए टेक्स्ट पैटर्न के लिए, एलिमेंट के कॉन्टेंट की खोज करता है. इसकी शुरुआत, दिए गए टेक्स्ट से होती है खोज के नतीजे.

JavaScript रेगुलर एक्सप्रेशन सुविधाओं का एक सबसेट पूरी तरह से काम नहीं करता, जैसे कि कैप्चर ग्रुप और मोड मॉडिफ़ायर.

दिया गया रेगुलर एक्सप्रेशन पैटर्न, हर टेक्स्ट ब्लॉक से अलग से मैच किया जाता है जो मौजूदा एलिमेंट में शामिल हों.

पैरामीटर

नामटाइपब्यौरा
searchPatternStringखोजने के लिए पैटर्न
fromRangeElementवह खोज नतीजा जिससे खोजना है

वापसी का टिकट

RangeElement — ऐसा खोज नतीजा, जो खोज के टेक्स्ट की अगली जगह दिखाता है या अगर कोई जगह नहीं है, तो यह शून्य होता है मिलान

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getAlignment()

HorizontalAlignment को वापस लाता है.

वापसी का टिकट

HorizontalAlignment — अलाइनमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getAttributes()

एलिमेंट के एट्रिब्यूट हासिल करता है.

नतीजा एक ऐसा ऑब्जेक्ट होता है जिसमें हर एक मान्य एलिमेंट एट्रिब्यूट के लिए एक प्रॉपर्टी होती है, जहां हर प्रॉपर्टी का नाम, DocumentApp.Attribute की गिनती में मौजूद किसी आइटम से मेल खाता है.

var doc = DocumentApp.getActiveDocument();
var documentTab = doc.getActiveTab().asDocumentTab();
var body = documentTab.getBody();

// Append a styled paragraph.
var par = body.appendParagraph('A bold, italicized paragraph.');
par.setBold(true);
par.setItalic(true);

// Retrieve the paragraph's attributes.
var atts = par.getAttributes();

// Log the paragraph attributes.
for (var att in atts) {
  Logger.log(att + ":" + atts[att]);
}

वापसी का टिकट

Object — एलिमेंट के एट्रिब्यूट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getChild(childIndex)

बताए गए चाइल्ड इंडेक्स में चाइल्ड एलीमेंट को हासिल करता है.

var body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Obtain the first element in the tab.
var firstChild = body.getChild(0);

// If it's a paragraph, set its contents.
if (firstChild.getType() == DocumentApp.ElementType.PARAGRAPH) {
  firstChild.asParagraph().setText("This is the first paragraph.");
}

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerफिर से पाने के लिए चाइल्ड एलिमेंट का इंडेक्स.

वापसी का टिकट

Element — बताए गए इंडेक्स में चाइल्ड एलिमेंट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getChildIndex(child)

बताए गए चाइल्ड एलिमेंट के लिए चाइल्ड इंडेक्स फिर से लाता है.

पैरामीटर

नामटाइपब्यौरा
childElementवह चाइल्ड एलिमेंट जिसके लिए इंडेक्स को फिर से हासिल करना है.

वापसी का टिकट

Integer — चाइल्ड इंडेक्स.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getGlyphType()

सूची आइटम के GlyphType को फिर से हासिल करता है.

वापसी का टिकट

GlyphType — ग्लिफ़ टाइप

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getHeading()

ParagraphHeading को वापस लाता है.

वापसी का टिकट

ParagraphHeading — हेडिंग

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getIndentEnd()

पॉइंट में आखिरी इंडेंट वापस लाता है.

वापसी का टिकट

Number — पॉइंट में आखिरी इंडेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getIndentFirstLine()

पॉइंट के हिसाब से, पहली लाइन का इंडेंट वापस लेता है.

वापसी का टिकट

Number — पॉइंट में पहली लाइन का इंडेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getIndentStart()

शुरुआती इंडेंटेशन वापस लाता है.

वापसी का टिकट

Number — शुरुआती इंडेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getLineSpacing()

लाइनों के बीच की दूरी को पॉइंट में दिखाता है.

वापसी का टिकट

Number — लाइनों के बीच की दूरी, पॉइंट में

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getLinkUrl()

लिंक के यूआरएल को वापस लाता है.

वापसी का टिकट

String — अगर एलिमेंट में इस एट्रिब्यूट के लिए एक से ज़्यादा वैल्यू हैं, तो लिंक का यूआरएल या शून्य

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getListId()

सूची आईडी की जानकारी हासिल करता है.

वापसी का टिकट

String — सूची का आईडी

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getNestingLevel()

सूची आइटम के नेस्टिंग स्तर को फिर से प्राप्त करता है.

डिफ़ॉल्ट रूप से, सूची आइटम का नेस्टिंग स्तर शून्य होता है. नेस्टिंग स्तर से ग्लिफ़ तय होता है इसका इस्तेमाल सूची आइटम में किया जाता है.

वापसी का टिकट

Integer — नेस्टिंग स्तर

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getNextSibling()

यह एलिमेंट का अगला सिबलिंग एलिमेंट हासिल करता है.

अगले सिबलिंग का वही पैरंट है और वे मौजूदा एलिमेंट को फ़ॉलो करते हैं.

वापसी का टिकट

Element — अगला सिबलिंग एलिमेंट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getNumChildren()

बच्चों की संख्या की जानकारी देता है.

var body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Log the number of elements in the tab.
Logger.log("There are " + body.getNumChildren() +
    " elements in the tab's body.");

वापसी का टिकट

Integer — बच्चों की संख्या.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getParent()

एलिमेंट के पैरंट एलिमेंट को हासिल करता है.

पैरंट एलिमेंट में मौजूदा एलिमेंट शामिल है.

वापसी का टिकट

ContainerElement — पैरंट एलिमेंट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getPositionedImage(id)

इमेज के आईडी के हिसाब से PositionedImage मिलता है.

पैरामीटर

नामटाइपब्यौरा
idStringइमेज आईडी

वापसी का टिकट

PositionedImage — पोज़िशन की गई इमेज

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getPositionedImages()

पैराग्राफ़ के साथ ऐंकर किए गए सभी PositionedImage ऑब्जेक्ट को शामिल करता है.

वापसी का टिकट

PositionedImage[] — पोज़िशन की गई इमेज की सूची

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getPreviousSibling()

यह एलिमेंट के पिछले सिबलिंग एलिमेंट को हासिल करता है.

पिछले सिबलिंग का पैरंट ही है और मौजूदा एलिमेंट से पहले आता है.

वापसी का टिकट

Element — पिछला सिबलिंग एलिमेंट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getSpacingAfter()

एलिमेंट के बाद, पॉइंट में स्पेस को हासिल करता है.

वापसी का टिकट

Number — एलिमेंट के बाद की स्पेस, पॉइंट में

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getSpacingBefore()

एलिमेंट के पहले की दूरी को पॉइंट में हासिल करता है.

वापसी का टिकट

Number — एलिमेंट के पहले की स्पेस, पॉइंट में

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getText()

एलिमेंट के कॉन्टेंट को टेक्स्ट स्ट्रिंग के तौर पर वापस लाता है.

वापसी का टिकट

String — टेक्स्ट स्ट्रिंग के रूप में एलिमेंट का कॉन्टेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getTextAlignment()

इससे टेक्स्ट अलाइनमेंट की सुविधा मिलती है. अलाइनमेंट के उपलब्ध टाइप DocumentApp.TextAlignment.NORMAL, DocumentApp.TextAlignment.SUBSCRIPT, और DocumentApp.TextAlignment.SUPERSCRIPT हैं.

वापसी का टिकट

TextAlignment — टेक्स्ट अलाइनमेंट का टाइप या अगर टेक्स्ट में एक से ज़्यादा तरह के टेक्स्ट शामिल हैं, तो null अलाइनमेंट या अगर टेक्स्ट अलाइनमेंट कभी सेट नहीं किया गया है

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getType()

एलिमेंट के ElementType को हासिल करता है.

दिए गए एलिमेंट का सटीक टाइप तय करने के लिए, getType() का इस्तेमाल करें.

var doc = DocumentApp.getActiveDocument();
var documentTab = doc.getActiveTab().asDocumentTab();
var body = documentTab.getBody();

// Obtain the first element in the active tab's body.

var firstChild = body.getChild(0);

// Use getType() to determine the element's type.
if (firstChild.getType() == DocumentApp.ElementType.PARAGRAPH) {
  Logger.log('The first element is a paragraph.');
} else {
  Logger.log('The first element is not a paragraph.');
}

वापसी का टिकट

ElementType — एलिमेंट का टाइप.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

insertHorizontalRule(childIndex)

तय किए गए इंडेक्स में HorizontalRule बनाता है और उसे शामिल करता है.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जिस पर एलिमेंट शामिल करना है

वापसी का टिकट

HorizontalRule — नया हॉरिज़ॉन्टल रूल एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

insertInlineImage(childIndex, image)

तय किए गए इमेज ब्लॉब से, एक नया InlineImage बनाता है और उसे शामिल करता है इंडेक्स करें.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जिस पर एलिमेंट शामिल करना है
imageBlobSourceइमेज का डेटा

वापसी का टिकट

InlineImage — इनलाइन इमेज एलिमेंट शामिल किया गया

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

insertInlineImage(childIndex, image)

दिए गए InlineImage को तय इंडेक्स में शामिल करता है.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जिस पर एलिमेंट शामिल करना है
imageInlineImageइमेज का डेटा

वापसी का टिकट

InlineImage — इनलाइन इमेज एलिमेंट शामिल किया गया

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

insertPageBreak(childIndex)

तय किए गए इंडेक्स में नया PageBreak बनाता है और उसे शामिल करता है.

ध्यान दें: हो सकता है कि PageBreaks, TableCells में शामिल न हो. अगर मौजूदा एलिमेंट किसी टेबल सेल में है, तो अपवाद दिखेगा.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जिस पर एलिमेंट शामिल करना है

वापसी का टिकट

PageBreak — नया पेज ब्रेक एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

insertPageBreak(childIndex, pageBreak)

दिए गए PageBreak को तय इंडेक्स में शामिल करता है.

ध्यान दें: हो सकता है कि PageBreaks, TableCells में शामिल न हो. अगर मौजूदा एलिमेंट किसी टेबल सेल में है, तो अपवाद दिखेगा.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जिस पर एलिमेंट शामिल करना है
pageBreakPageBreakP[शामिल करने के लिए उम्र का ब्रेक

वापसी का टिकट

PageBreak — शामिल किया गया पेज ब्रेक एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

insertText(childIndex, text)

तय इंडेक्स में नया टेक्स्ट एलिमेंट बनाता और जोड़ता है.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जिस पर एलिमेंट शामिल करना है
textStringटेक्स्ट का कॉन्टेंट

वापसी का टिकट

Text — नया टेक्स्ट एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

insertText(childIndex, text)

दिए गए Text एलिमेंट को तय इंडेक्स में, बताए गए टेक्स्ट के साथ शामिल करता है कॉन्टेंट.

पैरामीटर

नामटाइपब्यौरा
childIndexIntegerवह इंडेक्स जिस पर एलिमेंट शामिल करना है
textTextशामिल करने के लिए टेक्स्ट एलिमेंट

वापसी का टिकट

Text — शामिल किया गया टेक्स्ट एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

isAtDocumentEnd()

यह तय करता है कि एलिमेंट, Document के आखिर में है या नहीं.

वापसी का टिकट

Boolean — टैब के आखिर में एलिमेंट है या नहीं.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

isLeftToRight()

बाएं-से-दाएं सेटिंग फिर से लाता है.

वापसी का टिकट

Boolean — बाईं से दाईं ओर की सेटिंग

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

merge()

यह एलिमेंट को एक ही टाइप के पिछले सिबलिंग के साथ मर्ज करता है.

सिर्फ़ एक ही ElementType के एलिमेंट मर्ज किए जा सकते हैं. इसमें मौजूद कोई भी चाइल्ड एलिमेंट मौजूदा एलिमेंट को पिछले सिबलिंग एलिमेंट में ले जाया जाता है.

मौजूदा एलिमेंट को दस्तावेज़ से हटा दिया जाता है.

var doc = DocumentApp.getActiveDocument();
var documentTab = doc.getActiveTab().asDocumentTab();
var body = documentTab.getBody();

// Example 1: Merge paragraphs
// Append two paragraphs to the document's active tab.
var par1 = body.appendParagraph('Paragraph 1.');
var par2 = body.appendParagraph('Paragraph 2.');
// Merge the newly added paragraphs into a single paragraph.
par2.merge();

// Example 2: Merge table cells
// Create a two-dimensional array containing the table's cell contents.
var cells = [
['Row 1, Cell 1', 'Row 1, Cell 2'],
['Row 2, Cell 1', 'Row 2, Cell 2']
];
// Build a table from the array.
var table = body.appendTable(cells);
// Get the first row in the table.
 var row = table.getRow(0);
// Get the two cells in this row.
var cell1 = row.getCell(0);
var cell2 = row.getCell(1);
// Merge the current cell into its preceding sibling element.
var merged = cell2.merge();

वापसी का टिकट

ListItem — मर्ज किया गया एलिमेंट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

removeChild(child)

बताए गए चाइल्ड एलिमेंट को हटाता है.

पैरामीटर

नामटाइपब्यौरा
childElementहटाया जाने वाला चाइल्ड एलिमेंट

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

removeFromParent()

एलिमेंट को इसकी पैरंट जगह से हटाता है.

var doc = DocumentApp.getActiveDocument();
var documentTab = doc.getActiveTab().asDocumentTab()
var body = documentTab.getBody();

// Remove all images in the active tab's body.
var imgs = body.getImages();
for (var i = 0; i < imgs.length; i++) {
  imgs[i].removeFromParent();
}

वापसी का टिकट

ListItem — हटाया गया एलिमेंट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

removePositionedImage(id)

इमेज के आईडी से PositionedImage को हटाता है.

पैरामीटर

नामटाइपब्यौरा
idString

वापसी का टिकट

Boolean — तय की गई इमेज को हटाया गया है या नहीं

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

replaceText(searchPattern, replacement)

सामान्य का उपयोग करके, दिए गए बदले हुए स्ट्रिंग से दिए गए लेख पैटर्न की सभी आवृत्तियां बदलता है एक्सप्रेशन के बारे में भी बताया गया है.

खोज पैटर्न को स्ट्रिंग के तौर पर पास किया जाता है, न कि JavaScript रेगुलर एक्सप्रेशन ऑब्जेक्ट के तौर पर. इसलिए, आपको पैटर्न में बैकस्लैश को एस्केप करना होगा.

इस तरीके में, Google के RE2 रेगुलर एक्सप्रेशन का इस्तेमाल किया जाता है एक्सप्रेशन लाइब्रेरी, जो इस्तेमाल किए जा सकने वाले सिंटैक्स को सीमित करती है.

दिया गया रेगुलर एक्सप्रेशन पैटर्न, हर टेक्स्ट ब्लॉक से अलग से मैच किया जाता है जो मौजूदा एलिमेंट में शामिल हों.

var body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Clear the text surrounding "Apps Script", with or without text.
body.replaceText("^.*Apps ?Script.*$", "Apps Script");

पैरामीटर

नामटाइपब्यौरा
searchPatternStringखोजने के लिए रेगुलर एक्सप्रेशन पैटर्न
replacementStringबदले जाने के लिए इस्तेमाल किया जाने वाला टेक्स्ट

वापसी का टिकट

Element — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setAlignment(alignment)

HorizontalAlignment को सेट करता है.

पैरामीटर

नामटाइपब्यौरा
alignmentHorizontalAlignmentहॉरिज़ॉन्टल अलाइनमेंट

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setAttributes(attributes)

एलिमेंट के एट्रिब्यूट सेट करता है.

बताया गया विशेषता पैरामीटर एक ऐसा ऑब्जेक्ट होना चाहिए, जिसमें हर प्रॉपर्टी का नाम एक आइटम हो DocumentApp.Attribute की गिनती और हर प्रॉपर्टी की वैल्यू, नई वैल्यू होगी लागू किया गया.

var doc = DocumentApp.getActiveDocument();
var documentTab = doc.getActiveTab().asDocumentTab();
var body = documentTab.getBody();

// Define a custom paragraph style.
var style = {};
style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] =
    DocumentApp.HorizontalAlignment.RIGHT;
style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri';
style[DocumentApp.Attribute.FONT_SIZE] = 18;
style[DocumentApp.Attribute.BOLD] = true;

// Append a plain paragraph.
var par = body.appendParagraph('A paragraph with custom style.');

// Apply the custom style.
par.setAttributes(style);

पैरामीटर

नामटाइपब्यौरा
attributesObjectएलिमेंट के एट्रिब्यूट.

वापसी का टिकट

ListItem — मौजूदा एलिमेंट.

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setGlyphType(glyphType)

सूची आइटम के GlyphType को सेट करता है.

पैरामीटर

नामटाइपब्यौरा
glyphTypeGlyphTypeग्लिफ़ टाइप

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setHeading(heading)

ParagraphHeading को सेट करता है.

पैरामीटर

नामटाइपब्यौरा
headingParagraphHeadingहेडिंग

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setIndentEnd(indentEnd)

बिंदुओं में समाप्ति इंडेंट सेट करता है.

पैरामीटर

नामटाइपब्यौरा
indentEndNumberपॉइंट में आखिरी इंडेंट

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setIndentFirstLine(indentFirstLine)

पहली लाइन का इंडेंट, पॉइंट में सेट करता है.

पैरामीटर

नामटाइपब्यौरा
indentFirstLineNumberपहली पंक्ति का इंडेंट, पॉइंट में

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setIndentStart(indentStart)

पॉइंट के हिसाब से शुरुआती इंडेंट सेट करता है.

पैरामीटर

नामटाइपब्यौरा
indentStartNumberपॉइंट में शुरुआती इंडेंट

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setLeftToRight(leftToRight)

बाएं-से-दाएं सेटिंग को सेट करता है.

पैरामीटर

नामटाइपब्यौरा
leftToRightBooleanबाईं से दाईं ओर की सेटिंग

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setLineSpacing(multiplier)

लाइन के बीच की दूरी को संख्या के तौर पर सेट करता है. इससे पता चलता है कि स्पेसिंग के लिए लाइनों की संख्या कितनी है.

पैरामीटर

नामटाइपब्यौरा
multiplierNumberलाइनों की संख्या

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setLinkUrl(url)

लिंक का यूआरएल सेट करता है.

पैरामीटर

नामटाइपब्यौरा
urlStringलिंक का यूआरएल

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setListId(listItem)

सूची आईडी सेट करता है.

सूची आईडी को बताए गए ListItem के लिए समान मान पर सेट किया गया है. दोनों ListItems को एक ही सूची का सदस्य माना जाएगा.

पैरामीटर

नामटाइपब्यौरा
listItemListItemवह सूची आइटम जिसका सूची आईडी इस्तेमाल करना है

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setNestingLevel(nestingLevel)

सूची आइटम का नेस्टिंग स्तर सेट करता है.

डिफ़ॉल्ट रूप से, सूची आइटम का नेस्टिंग स्तर शून्य होता है. नेस्टिंग स्तर से ग्लिफ़ तय होता है इसका इस्तेमाल सूची आइटम में किया जाता है.

पैरामीटर

नामटाइपब्यौरा
nestingLevelIntegerनेस्टिंग स्तर

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setSpacingAfter(spacingAfter)

एलिमेंट के बाद, पॉइंट में स्पेस सेट करता है.

पैरामीटर

नामटाइपब्यौरा
spacingAfterNumberएलिमेंट के बाद की स्पेस, पॉइंट में

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setSpacingBefore(spacingBefore)

एलिमेंट के पहले की स्पेस को पॉइंट में सेट करता है.

पैरामीटर

नामटाइपब्यौरा
spacingBeforeNumberएलिमेंट के पहले की दूरी, पॉइंट में

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setText(text)

सूची के आइटम के कॉन्टेंट को टेक्स्ट के तौर पर सेट करता है.

ध्यान दें: मौजूदा कॉन्टेंट हटा दिया गया है.

पैरामीटर

नामटाइपब्यौरा
textStringनया टेक्स्ट कॉन्टेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setTextAlignment(textAlignment)

टेक्स्ट अलाइनमेंट सेट करता है. अलाइनमेंट के उपलब्ध टाइप DocumentApp.TextAlignment.NORMAL, DocumentApp.TextAlignment.SUBSCRIPT, और DocumentApp.TextAlignment.SUPERSCRIPT हैं.

// Make the entire first paragraph in the active tab be superscript.
var documentTab = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab();
var text = documentTab.getBody().getParagraphs()[0].editAsText();
text.setTextAlignment(DocumentApp.TextAlignment.SUPERSCRIPT);

पैरामीटर

नामटाइपब्यौरा
textAlignmentTextAlignmentलागू किए जाने वाले लेख संरेखण का प्रकार

वापसी का टिकट

ListItem — मौजूदा एलिमेंट

अनुमति देना

इस तरीके का इस्तेमाल करने वाली स्क्रिप्ट के लिए, यहां दिए गए एक या एक से ज़्यादा स्कोप की अनुमति होनी चाहिए:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents