Class Text

পাঠ্য

একটি সমৃদ্ধ পাঠ্য অঞ্চলের প্রতিনিধিত্বকারী একটি উপাদান৷ একটি Document সমস্ত পাঠ্য Text উপাদানগুলির মধ্যে রয়েছে৷ একটি Text উপাদান একটি Equation , EquationFunction , ListItem , বা Paragraph মধ্যে ধারণ করা যেতে পারে, কিন্তু নিজেই অন্য কোনো উপাদান ধারণ করতে পারে না। দস্তাবেজ গঠন সম্পর্কে আরও তথ্যের জন্য, Google ডক্স প্রসারিত করার নির্দেশিকা দেখুন।

// Gets the body contents of the active tab.
var body = DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Use editAsText to obtain a single text element containing
// all the characters in the tab.
var text = body.editAsText();

// Insert text at the beginning of the tab.
text.insertText(0, 'Inserted text.\n');

// Insert text at the end of the tab.
text.appendText('\nAppended text.');

// Make the first half of the tab blue.
text.setForegroundColor(0, text.getText().length / 2, '#00FFFF');

পদ্ধতি

পদ্ধতিরিটার্ন টাইপসংক্ষিপ্ত বিবরণ
appendText(text)Textএই পাঠ্য অঞ্চলের শেষে নির্দিষ্ট পাঠ্য যোগ করে।
copy()Textবর্তমান উপাদানের একটি বিচ্ছিন্ন, গভীর অনুলিপি প্রদান করে।
deleteText(startOffset, endOffsetInclusive)Textপাঠ্যের একটি পরিসীমা মুছে দেয়।
editAsText()Textসম্পাদনার জন্য বর্তমান উপাদানটির একটি Text সংস্করণ পায়।
findText(searchPattern)RangeElementরেগুলার এক্সপ্রেশন ব্যবহার করে নির্দিষ্ট টেক্সট প্যাটার্নের জন্য উপাদানের বিষয়বস্তু অনুসন্ধান করে।
findText(searchPattern, from)RangeElementএকটি প্রদত্ত অনুসন্ধান ফলাফল থেকে শুরু করে, নির্দিষ্ট পাঠ্য প্যাটার্নের জন্য উপাদানের বিষয়বস্তু অনুসন্ধান করে।
getAttributes()Objectউপাদানের বৈশিষ্ট্য পুনরুদ্ধার করে।
getAttributes(offset)Objectনির্দিষ্ট অক্ষর অফসেটে বৈশিষ্ট্য পুনরুদ্ধার করে।
getBackgroundColor()Stringব্যাকগ্রাউন্ড কালার সেটিং পুনরুদ্ধার করে।
getBackgroundColor(offset)Stringনির্দিষ্ট অক্ষর অফসেটে পটভূমির রঙ পুনরুদ্ধার করে।
getFontFamily()Stringফন্ট ফ্যামিলি সেটিং পুনরুদ্ধার করে।
getFontFamily(offset)Stringনির্দিষ্ট অক্ষর অফসেটে ফন্ট পরিবার পুনরুদ্ধার করে।
getFontSize()Numberফন্ট সাইজ সেটিং পুনরুদ্ধার করে।
getFontSize(offset)Numberনির্দিষ্ট অক্ষর অফসেটে ফন্টের আকার পুনরুদ্ধার করে।
getForegroundColor()Stringফোরগ্রাউন্ড কালার সেটিং পুনরুদ্ধার করে।
getForegroundColor(offset)Stringনির্দিষ্ট অক্ষর অফসেটে অগ্রভাগের রঙ পুনরুদ্ধার করে।
getLinkUrl()Stringলিঙ্ক url পুনরুদ্ধার করে.
getLinkUrl(offset)Stringনির্দিষ্ট অক্ষর অফসেটে লিঙ্ক URL পুনরুদ্ধার করে।
getNextSibling()Elementউপাদানটির পরবর্তী সহোদর উপাদানটি পুনরুদ্ধার করে৷
getParent()ContainerElementউপাদানটির মূল উপাদান পুনরুদ্ধার করে।
getPreviousSibling()Elementউপাদানটির পূর্ববর্তী ভাইবোন উপাদান পুনরুদ্ধার করে।
getText()Stringএকটি পাঠ্য স্ট্রিং হিসাবে উপাদানের বিষয়বস্তু পুনরুদ্ধার করে।
getTextAlignment()TextAlignmentপাঠ্য প্রান্তিককরণ পায়।
getTextAlignment(offset)TextAlignmentএকটি একক অক্ষরের জন্য পাঠ্য প্রান্তিককরণ পায়।
getTextAttributeIndices()Integer[]স্বতন্ত্র টেক্সট ফরম্যাটিং রানের শুরুর সাথে সঙ্গতিপূর্ণ টেক্সট সূচকের সেট পুনরুদ্ধার করে।
getType()ElementTypeউপাদানটির ElementType পুনরুদ্ধার করে।
insertText(offset, text)Textপ্রদত্ত অক্ষর অফসেটে নির্দিষ্ট পাঠ্য সন্নিবেশ করান।
isAtDocumentEnd()Booleanউপাদানটি Document শেষে আছে কিনা তা নির্ধারণ করে।
isBold()Booleanসাহসী সেটিং পুনরুদ্ধার করে।
isBold(offset)Booleanনির্দিষ্ট অক্ষর অফসেটে বোল্ড সেটিং পুনরুদ্ধার করে।
isItalic()Booleanতির্যক সেটিং পুনরুদ্ধার করে।
isItalic(offset)Booleanনির্দিষ্ট অক্ষর অফসেটে তির্যক সেটিং পুনরুদ্ধার করে।
isStrikethrough()Booleanস্ট্রাইকথ্রু সেটিং পুনরুদ্ধার করে।
isStrikethrough(offset)Booleanনির্দিষ্ট অক্ষর অফসেটে স্ট্রাইকথ্রু সেটিং পুনরুদ্ধার করে।
isUnderline()Booleanআন্ডারলাইন সেটিং পুনরুদ্ধার করে।
isUnderline(offset)Booleanনির্দিষ্ট অক্ষর অফসেটে আন্ডারলাইন সেটিং পুনরুদ্ধার করে।
merge()Textএকই ধরনের পূর্ববর্তী ভাইবোনের সাথে উপাদানটিকে মার্জ করে।
removeFromParent()Textউপাদানটিকে তার অভিভাবক থেকে সরিয়ে দেয়।
replaceText(searchPattern, replacement)Elementরেগুলার এক্সপ্রেশন ব্যবহার করে একটি প্রদত্ত টেক্সট প্যাটার্নের সমস্ত ঘটনাকে একটি প্রদত্ত প্রতিস্থাপন স্ট্রিং দিয়ে প্রতিস্থাপন করে।
setAttributes(startOffset, endOffsetInclusive, attributes)Textপ্রদত্ত অক্ষর পরিসরে নির্দিষ্ট বৈশিষ্ট্যগুলি প্রয়োগ করে।
setAttributes(attributes)Textউপাদানের বৈশিষ্ট্য সেট করে।
setBackgroundColor(startOffset, endOffsetInclusive, color)Textনির্দিষ্ট অক্ষর পরিসরের জন্য পটভূমির রঙ সেট করে।
setBackgroundColor(color)Textপটভূমির রঙ সেট করে।
setBold(bold)Textবোল্ড সেটিং সেট করে।
setBold(startOffset, endOffsetInclusive, bold)Textনির্দিষ্ট অক্ষর পরিসরের জন্য বোল্ড সেটিং সেট করে।
setFontFamily(startOffset, endOffsetInclusive, fontFamilyName)Textনির্দিষ্ট অক্ষর পরিসরের জন্য ফন্ট পরিবার সেট করে।
setFontFamily(fontFamilyName)Textফন্ট পরিবার সেট করে।
setFontSize(startOffset, endOffsetInclusive, size)Textনির্দিষ্ট অক্ষর পরিসরের জন্য ফন্টের আকার সেট করে।
setFontSize(size)Textফন্ট সাইজ সেট করে।
setForegroundColor(startOffset, endOffsetInclusive, color)Textনির্দিষ্ট অক্ষর পরিসরের জন্য অগ্রভাগের রঙ সেট করে।
setForegroundColor(color)Textঅগ্রভাগের রঙ সেট করে।
setItalic(italic)Textতির্যক সেটিং সেট করে।
setItalic(startOffset, endOffsetInclusive, italic)Textনির্দিষ্ট অক্ষর পরিসরের জন্য তির্যক সেটিং সেট করে।
setLinkUrl(startOffset, endOffsetInclusive, url)Textনির্দিষ্ট অক্ষর পরিসরের জন্য লিঙ্ক URL সেট করে।
setLinkUrl(url)Textলিঙ্ক url সেট করে।
setStrikethrough(strikethrough)Textস্ট্রাইকথ্রু সেটিং সেট করে।
setStrikethrough(startOffset, endOffsetInclusive, strikethrough)Textনির্দিষ্ট অক্ষর পরিসরের জন্য স্ট্রাইকথ্রু সেটিং সেট করে।
setText(text)Textপাঠ্য বিষয়বস্তু সেট করে।
setTextAlignment(startOffset, endOffsetInclusive, textAlignment)Textএকটি প্রদত্ত অক্ষর পরিসরের জন্য পাঠ্য সারিবদ্ধকরণ সেট করে।
setTextAlignment(textAlignment)Textপাঠ্য সারিবদ্ধকরণ সেট করে।
setUnderline(underline)Textআন্ডারলাইন সেটিং সেট করে।
setUnderline(startOffset, endOffsetInclusive, underline)Textনির্দিষ্ট অক্ষর পরিসরের জন্য আন্ডারলাইন সেটিং সেট করে।

বিস্তারিত ডকুমেন্টেশন

appendText(text)

এই পাঠ্য অঞ্চলের শেষে নির্দিষ্ট পাঠ্য যোগ করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Adds the text, 'Sample body text,' to the end of the tab body.
const text = body.editAsText().appendText('Sample body text');

পরামিতি

নামটাইপবর্ণনা
textStringযোগ করার জন্য পাঠ্য।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

copy()

বর্তমান উপাদানের একটি বিচ্ছিন্ন, গভীর অনুলিপি প্রদান করে।

উপাদান উপস্থিত কোনো শিশু উপাদান এছাড়াও অনুলিপি করা হয়. নতুন উপাদানটির কোনো অভিভাবক নেই৷

প্রত্যাবর্তন

Text - নতুন অনুলিপি।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

deleteText(startOffset, endOffsetInclusive)

পাঠ্যের একটি পরিসীমা মুছে দেয়।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Deletes the first 10 characters in the body.
 const text = body.editAsText().deleteText(0, 9);

পরামিতি

নামটাইপবর্ণনা
startOffsetIntegerমুছে ফেলার জন্য প্রথম অক্ষরের অফসেট অক্ষর।
endOffsetInclusiveIntegerমুছে ফেলার শেষ অক্ষরের অফসেট অক্ষর।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

  • 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 - বর্তমান উপাদানের একটি পাঠ্য সংস্করণ


findText(searchPattern)

রেগুলার এক্সপ্রেশন ব্যবহার করে নির্দিষ্ট টেক্সট প্যাটার্নের জন্য উপাদানের বিষয়বস্তু অনুসন্ধান করে।

জাভাস্ক্রিপ্ট রেগুলার এক্সপ্রেশন বৈশিষ্ট্যগুলির একটি উপসেট সম্পূর্ণরূপে সমর্থিত নয়, যেমন ক্যাপচার গ্রুপ এবং মোড মডিফায়ার।

প্রদত্ত রেগুলার এক্সপ্রেশন প্যাটার্নটি বর্তমান উপাদানে থাকা প্রতিটি টেক্সট ব্লকের সাথে স্বাধীনভাবে মিলে যায়।

পরামিতি

নামটাইপবর্ণনা
searchPatternStringঅনুসন্ধান করার জন্য প্যাটার্ন

প্রত্যাবর্তন

RangeElement — একটি অনুসন্ধান ফলাফল অনুসন্ধান পাঠ্যের অবস্থান নির্দেশ করে, অথবা যদি কোনো মিল না থাকে তাহলে শূন্য

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

findText(searchPattern, from)

একটি প্রদত্ত অনুসন্ধান ফলাফল থেকে শুরু করে, নির্দিষ্ট পাঠ্য প্যাটার্নের জন্য উপাদানের বিষয়বস্তু অনুসন্ধান করে।

জাভাস্ক্রিপ্ট রেগুলার এক্সপ্রেশন বৈশিষ্ট্যগুলির একটি উপসেট সম্পূর্ণরূপে সমর্থিত নয়, যেমন ক্যাপচার গ্রুপ এবং মোড মডিফায়ার।

প্রদত্ত রেগুলার এক্সপ্রেশন প্যাটার্নটি বর্তমান উপাদানে থাকা প্রতিটি টেক্সট ব্লকের সাথে স্বাধীনভাবে মিলে যায়।

পরামিতি

নামটাইপবর্ণনা
searchPatternStringঅনুসন্ধান করার জন্য প্যাটার্ন
fromRangeElementঅনুসন্ধান ফলাফল থেকে অনুসন্ধান

প্রত্যাবর্তন

RangeElement — একটি অনুসন্ধান ফলাফল অনুসন্ধান পাঠ্যের পরবর্তী অবস্থান নির্দেশ করে, অথবা যদি কোনো মিল না থাকে তাহলে শূন্য

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

  • 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

getAttributes(offset)

নির্দিষ্ট অক্ষর অফসেটে বৈশিষ্ট্য পুনরুদ্ধার করে।

ফলাফল হল প্রতিটি বৈধ টেক্সট অ্যাট্রিবিউটের জন্য একটি প্রপার্টি ধারণকারী একটি বস্তু যেখানে প্রতিটি সম্পত্তির নাম DocumentApp.Attribute গণনার একটি আইটেমের সাথে মিলে যায়।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Declares style attributes.
const style = {}
style[DocumentApp.Attribute.BOLD] = true;
style[DocumentApp.Attribute.ITALIC] = true;
style[DocumentApp.Attribute.FONT_SIZE] = 29;

// Sets the style attributes to the tab's body.
const text = body.editAsText();
text.setAttributes(style);

// Gets the style attributes applied to the eleventh character in the
// body and logs them to the console.
const attributes = text.getAttributes(10);
console.log(attributes);

পরামিতি

নামটাইপবর্ণনা
offsetIntegerচরিত্র অফসেট.

প্রত্যাবর্তন

Object - উপাদানের বৈশিষ্ট্য।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getBackgroundColor()

ব্যাকগ্রাউন্ড কালার সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

String — পটভূমির রঙ, সিএসএস স্বরলিপিতে ফর্ম্যাট করা (যেমন '#ffffff' ), অথবা যদি উপাদানটিতে এই বৈশিষ্ট্যের জন্য একাধিক মান থাকে তাহলে শূন্য

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getBackgroundColor(offset)

নির্দিষ্ট অক্ষর অফসেটে পটভূমির রঙ পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the background color of the first 3 characters in the body.
const text = body.editAsText().setBackgroundColor(0, 2, '#FFC0CB');

// Gets the background color of the first character in the body.
const backgroundColor = text.getBackgroundColor(0);

// Logs the background color to the console.
console.log(backgroundColor);

পরামিতি

নামটাইপবর্ণনা
offsetIntegerচরিত্র অফসেট.

প্রত্যাবর্তন

String — পটভূমির রঙ, CSS স্বরলিপিতে বিন্যাসিত (যেমন '#ffffff' )।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getFontFamily()

ফন্ট ফ্যামিলি সেটিং পুনরুদ্ধার করে। নামটি ডক্স বা Google ফন্টের ফন্ট মেনু থেকে যেকোনো ফন্ট হতে পারে এবং এটি কেস-সংবেদনশীল। getFontFamily() এবং setFontFamily(fontFamilyName) পদ্ধতিগুলি এখন FontFamily enum-এর পরিবর্তে ফন্টের জন্য স্ট্রিং নাম ব্যবহার করে। যদিও এই enumটি অবমূল্যায়িত করা হয়েছে, এটি পুরানো স্ক্রিপ্টগুলির সাথে সামঞ্জস্যের জন্য উপলব্ধ থাকবে।

প্রত্যাবর্তন

String — ফন্ট ফ্যামিলি, বা নাল যদি এলিমেন্টে এই অ্যাট্রিবিউটের একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getFontFamily(offset)

নির্দিষ্ট অক্ষর অফসেটে ফন্ট পরিবার পুনরুদ্ধার করে। নামটি ডক্স বা Google ফন্টের ফন্ট মেনু থেকে যেকোনো ফন্ট হতে পারে এবং এটি কেস-সংবেদনশীল। getFontFamily() এবং setFontFamily(fontFamilyName) পদ্ধতিগুলি এখন FontFamily enum-এর পরিবর্তে ফন্টের জন্য স্ট্রিং নাম ব্যবহার করে। যদিও এই enumটি অবমূল্যায়িত করা হয়েছে, এটি পুরানো স্ক্রিপ্টগুলির সাথে সামঞ্জস্যের জন্য উপলব্ধ থাকবে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the font of the first 16 characters to Impact.
const text = body.editAsText().setFontFamily(0, 15, 'Impact');

// Gets the font family of the 16th character in the tab body.
const fontFamily = text.getFontFamily(15);

// Logs the font family to the console.
console.log(fontFamily);

পরামিতি

নামটাইপবর্ণনা
offsetIntegerচরিত্র অফসেট.

প্রত্যাবর্তন

String - ফন্ট পরিবার।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getFontSize()

ফন্ট সাইজ সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

Number — ফন্টের আকার, বা শূন্য যদি উপাদানটিতে এই বৈশিষ্ট্যের জন্য একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getFontSize(offset)

নির্দিষ্ট অক্ষর অফসেটে ফন্টের আকার পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the font size of the first 13 characters to 15.
const text = body.editAsText().setFontSize(0, 12, 15);

// Gets the font size of the first character.
const fontSize = text.getFontSize(0);

// Logs the font size to the console.
console.log(fontSize);

পরামিতি

নামটাইপবর্ণনা
offsetIntegerচরিত্র অফসেট.

প্রত্যাবর্তন

Number - ফন্টের আকার।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getForegroundColor()

ফোরগ্রাউন্ড কালার সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

String — অগ্রভাগের রঙ, সিএসএস স্বরলিপিতে ফর্ম্যাট করা (যেমন '#ffffff' ), অথবা যদি উপাদানটিতে এই বৈশিষ্ট্যের জন্য একাধিক মান থাকে তাহলে শূন্য

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getForegroundColor(offset)

নির্দিষ্ট অক্ষর অফসেটে অগ্রভাগের রঙ পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the foreground color of the first 3 characters in the tab body.
const text = body.editAsText().setForegroundColor(0, 2, '#0000FF');

// Gets the foreground color of the first character in the tab body.
const foregroundColor = text.getForegroundColor(0);

// Logs the foreground color to the console.
console.log(foregroundcolor);

পরামিতি

নামটাইপবর্ণনা
offsetIntegerচরিত্র অফসেট.

প্রত্যাবর্তন

String — অগ্রভাগের রঙ, CSS স্বরলিপিতে বিন্যাসিত (যেমন '#ffffff' )।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getLinkUrl()

লিঙ্ক url পুনরুদ্ধার করে.

প্রত্যাবর্তন

String — লিঙ্ক url, বা নাল যদি উপাদানটিতে এই বৈশিষ্ট্যের জন্য একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getLinkUrl(offset)

নির্দিষ্ট অক্ষর অফসেটে লিঙ্ক URL পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Applies a link to the first 10 characters in the body.
const text = body.editAsText().setLinkUrl(0, 9, 'https://www.example.com/');

// Gets the URL of the link from the first character.
const link = text.getLinkUrl(0);

// Logs the link URL to the console.
console.log(link);

পরামিতি

নামটাইপবর্ণনা
offsetIntegerচরিত্র অফসেট.

প্রত্যাবর্তন

String - লিঙ্ক URL.

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

  • 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

getParent()

উপাদানটির মূল উপাদান পুনরুদ্ধার করে।

মূল উপাদান বর্তমান উপাদান ধারণ করে.

প্রত্যাবর্তন

ContainerElement — মূল উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

  • 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

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

getTextAlignment(offset)

একটি একক অক্ষরের জন্য পাঠ্য প্রান্তিককরণ পায়। সারিবদ্ধকরণের উপলব্ধ প্রকারগুলি হল DocumentApp.TextAlignment.NORMAL , DocumentApp.TextAlignment.SUBSCRIPT , এবং DocumentApp.TextAlignment.SUPERSCRIPT

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the text alignment of the tab's body to NORMAL.
const text = body.editAsText().setTextAlignment(DocumentApp.TextAlignment.NORMAL);

// Gets the text alignment of the ninth character.
const alignment = text.getTextAlignment(8);

// Logs the text alignment to the console.
console.log(alignment.toString());

পরামিতি

নামটাইপবর্ণনা
offsetIntegerচরিত্রের অফসেট।

প্রত্যাবর্তন

TextAlignment — টেক্সট অ্যালাইনমেন্টের ধরন, অথবা যদি টেক্সট অ্যালাইনমেন্ট কখনও সেট করা না থাকে তাহলে null

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

getTextAttributeIndices()

স্বতন্ত্র টেক্সট ফরম্যাটিং রানের শুরুর সাথে সঙ্গতিপূর্ণ টেক্সট সূচকের সেট পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Gets the text indices at which text formatting changes.
const indices = body.editAsText().getTextAttributeIndices();

// Logs the indices to the console.
console.log(indices.toString());

প্রত্যাবর্তন

Integer[] — পাঠ্য সূচকের সেট যেখানে পাঠ্য বিন্যাস পরিবর্তন হয়।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

  • 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

insertText(offset, text)

প্রদত্ত অক্ষর অফসেটে নির্দিষ্ট পাঠ্য সন্নিবেশ করান।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Inserts the text, 'Sample inserted text', at the start of the body content.
const text = body.editAsText().insertText(0, 'Sample inserted text');

পরামিতি

নামটাইপবর্ণনা
offsetIntegerঅক্ষর অফসেট যেখানে পাঠ্য সন্নিবেশ করা হবে।
textStringটেক্সট সন্নিবেশ করান.

প্রত্যাবর্তন

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

isBold()

সাহসী সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

Boolean — টেক্সটটি বোল্ড হোক বা শূন্য যদি এলিমেন্টে এই অ্যাট্রিবিউটের জন্য একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isBold(offset)

নির্দিষ্ট অক্ষর অফসেটে বোল্ড সেটিং পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Bolds the first 4 characters in the tab body.
const text = body.editAsText().setBold(0, 3, true);

// Gets whether or not the text is bold.
const bold = text.editAsText().isBold(0);

// Logs the text's bold setting to the console
console.log(bold);

পরামিতি

নামটাইপবর্ণনা
offsetIntegerচরিত্র অফসেট.

প্রত্যাবর্তন

Boolean — সাহসী সেটিং।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isItalic()

তির্যক সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

Boolean — টেক্সটটি তির্যক হোক বা শূন্য যদি উপাদানটিতে এই বৈশিষ্ট্যের জন্য একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isItalic(offset)

নির্দিষ্ট অক্ষর অফসেটে তির্যক সেটিং পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the first 13 characters of the tab body to italic.
const text = body.editAsText().setItalic(0, 12, true);

// Gets whether the fifth character in the tab body is set to
// italic and logs it to the console.
const italic = text.isItalic(4);
console.log(italic);

পরামিতি

নামটাইপবর্ণনা
offsetIntegerচরিত্র অফসেট.

প্রত্যাবর্তন

Boolean — তির্যক সেটিং।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isStrikethrough()

স্ট্রাইকথ্রু সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

Boolean — টেক্সট স্ট্রাইকথ্রু হোক বা শূন্য হোক যদি উপাদানটিতে এই অ্যাট্রিবিউটের একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isStrikethrough(offset)

নির্দিষ্ট অক্ষর অফসেটে স্ট্রাইকথ্রু সেটিং পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the first 17 characters of the tab body to strikethrough.
const text = body.editAsText().setStrikethrough(0, 16, true);

// Gets whether the first character in the tab body is set to
// strikethrough and logs it to the console.
const strikethrough = text.isStrikethrough(0);
console.log(strikethrough);

পরামিতি

নামটাইপবর্ণনা
offsetIntegerচরিত্র অফসেট.

প্রত্যাবর্তন

Boolean — স্ট্রাইকথ্রু সেটিং।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isUnderline()

আন্ডারলাইন সেটিং পুনরুদ্ধার করে।

প্রত্যাবর্তন

Boolean — টেক্সট আন্ডারলাইন করা হোক বা শূন্য যদি এলিমেন্টে এই অ্যাট্রিবিউটের জন্য একাধিক মান থাকে

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

isUnderline(offset)

নির্দিষ্ট অক্ষর অফসেটে আন্ডারলাইন সেটিং পুনরুদ্ধার করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the first 13 characters of the tab body to underline.
const text = body.editAsText().setUnderline(0, 12, false);

// Gets whether the first character in the tab body is set to
// underline and logs it to the console
const underline = text.editAsText().isUnderline(0);
console.log(underline);

পরামিতি

নামটাইপবর্ণনা
offsetIntegerচরিত্র অফসেট.

প্রত্যাবর্তন

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();

প্রত্যাবর্তন

Text - একত্রিত উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

  • 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();
}

প্রত্যাবর্তন

Text - সরানো উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

replaceText(searchPattern, replacement)

রেগুলার এক্সপ্রেশন ব্যবহার করে একটি প্রদত্ত টেক্সট প্যাটার্নের সমস্ত ঘটনাকে একটি প্রদত্ত প্রতিস্থাপন স্ট্রিং দিয়ে প্রতিস্থাপন করে।

অনুসন্ধান প্যাটার্নটি একটি স্ট্রিং হিসাবে পাস করা হয়, একটি জাভাস্ক্রিপ্ট রেগুলার এক্সপ্রেশন অবজেক্ট নয়। এর কারণে আপনাকে প্যাটার্নে যেকোনো ব্যাকস্ল্যাশ এড়াতে হবে।

এই পদ্ধতিগুলি 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অনুসন্ধান করার জন্য regex প্যাটার্ন
replacementStringপ্রতিস্থাপন হিসাবে ব্যবহার করার জন্য পাঠ্য

প্রত্যাবর্তন

Element - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setAttributes(startOffset, endOffsetInclusive, attributes)

প্রদত্ত অক্ষর পরিসরে নির্দিষ্ট বৈশিষ্ট্যগুলি প্রয়োগ করে।

নির্দিষ্ট বৈশিষ্ট্যের প্যারামিটারটি অবশ্যই একটি বস্তু হতে হবে যেখানে প্রতিটি সম্পত্তির নাম DocumentApp.Attribute গণনার একটি আইটেম এবং প্রতিটি সম্পত্তির মান প্রয়োগ করা নতুন মান।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Declares style attributes for font size and font family.
const style = {}
style[DocumentApp.Attribute.FONT_SIZE] = 20 ;
style[DocumentApp.Attribute.FONT_FAMILY] = 'Impact';

// Sets the style attributes to the first 9 characters in the tab's body.
const text = body.setAttributes(0, 8, style);

পরামিতি

নামটাইপবর্ণনা
startOffsetIntegerটেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusiveIntegerপাঠ্য পরিসরের শেষ অফসেট।
attributesObjectউপাদান এর বৈশিষ্ট্য.

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

  • 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উপাদান এর বৈশিষ্ট্য.

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setBackgroundColor(startOffset, endOffsetInclusive, color)

নির্দিষ্ট অক্ষর পরিসরের জন্য পটভূমির রঙ সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the background color of the first 3 characters in the
// tab body to hex color #0000FF.
const text = body.editAsText().setBackgroundColor(0, 2, '#0000FF');

পরামিতি

নামটাইপবর্ণনা
startOffsetIntegerটেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusiveIntegerপাঠ্য পরিসরের শেষ অফসেট।
colorStringপটভূমির রঙ, CSS স্বরলিপিতে বিন্যাসিত (যেমন '#ffffff' )।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setBackgroundColor(color)

পটভূমির রঙ সেট করে।

পরামিতি

নামটাইপবর্ণনা
colorStringপটভূমির রঙ, CSS স্বরলিপিতে বিন্যাসিত (যেমন '#ffffff' )

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setBold(bold)

বোল্ড সেটিং সেট করে।

পরামিতি

নামটাইপবর্ণনা
boldBooleanসাহসী সেটিং

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setBold(startOffset, endOffsetInclusive, bold)

নির্দিষ্ট অক্ষর পরিসরের জন্য বোল্ড সেটিং সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the first 11 characters in the tab's body to bold.
const text = body.editAsText().setBold(0, 10, true);

পরামিতি

নামটাইপবর্ণনা
startOffsetIntegerটেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusiveIntegerপাঠ্য পরিসরের শেষ অফসেট।
boldBooleanসাহসী সেটিং।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setFontFamily(startOffset, endOffsetInclusive, fontFamilyName)

নির্দিষ্ট অক্ষর পরিসরের জন্য ফন্ট পরিবার সেট করে। নামটি ডক্স বা Google ফন্টের ফন্ট মেনু থেকে যেকোনো ফন্ট হতে পারে এবং এটি কেস-সংবেদনশীল। অচেনা ফন্টের নাম Arial হিসেবে রেন্ডার হবে। getFontFamily(offset) এবং setFontFamily(fontFamilyName) পদ্ধতিগুলি এখন FontFamily enum-এর পরিবর্তে ফন্টগুলির জন্য স্ট্রিং নাম ব্যবহার করে। যদিও এই enumটি অবমূল্যায়িত করা হয়েছে, এটি পুরানো স্ক্রিপ্টগুলির সাথে সামঞ্জস্যের জন্য উপলব্ধ থাকবে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the font of the first 4 characters in the tab's body to Roboto.
const text = body.editAsText().setFontFamily(0, 3, 'Roboto');

পরামিতি

নামটাইপবর্ণনা
startOffsetIntegerটেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusiveIntegerপাঠ্য পরিসরের শেষ অফসেট।
fontFamilyNameStringডক্স বা Google ফন্টের ফন্ট মেনু থেকে ফন্ট পরিবারের নাম।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setFontFamily(fontFamilyName)

ফন্ট পরিবার সেট করে। নামটি ডক্স বা Google ফন্টের ফন্ট মেনু থেকে যেকোনো ফন্ট হতে পারে এবং এটি কেস-সংবেদনশীল। অচেনা ফন্টের নাম Arial হিসেবে রেন্ডার হবে। getFontFamily() এবং setFontFamily(fontFamilyName) পদ্ধতিগুলি এখন FontFamily enum-এর পরিবর্তে ফন্টের জন্য স্ট্রিং নাম ব্যবহার করে। যদিও এই enumটি অবমূল্যায়িত করা হয়েছে, এটি পুরানো স্ক্রিপ্টগুলির সাথে সামঞ্জস্যের জন্য উপলব্ধ থাকবে।

পরামিতি

নামটাইপবর্ণনা
fontFamilyNameStringডক্স বা Google ফন্টের ফন্ট মেনু থেকে ফন্ট পরিবারের নাম

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setFontSize(startOffset, endOffsetInclusive, size)

নির্দিষ্ট অক্ষর পরিসরের জন্য ফন্টের আকার সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the size of the first 11 characters in the tab's body to 12.
const text = body.editAsText().setFontSize(0, 10, 12);

পরামিতি

নামটাইপবর্ণনা
startOffsetIntegerটেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusiveIntegerপাঠ্য পরিসরের শেষ অফসেট।
sizeNumberফন্টের আকার।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setFontSize(size)

ফন্ট সাইজ সেট করে।

পরামিতি

নামটাইপবর্ণনা
sizeNumberফন্টের আকার

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setForegroundColor(startOffset, endOffsetInclusive, color)

নির্দিষ্ট অক্ষর পরিসরের জন্য অগ্রভাগের রঙ সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the foreground color of the first 2 characters in the
// tab's body to hex color #FF0000.
const text = body.editAsText().setForegroundColor(0, 1, '#FF0000');

// Gets the foreground color for the second character in the tab's body.
const foregroundColor = text.getForegroundColor(1);

//  Logs the foreground color to the console.
console.log(foregroundColor);

পরামিতি

নামটাইপবর্ণনা
startOffsetIntegerটেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusiveIntegerপাঠ্য পরিসরের শেষ অফসেট।
colorStringঅগ্রভাগের রঙ, CSS স্বরলিপিতে বিন্যাসিত (যেমন '#ffffff' )।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setForegroundColor(color)

অগ্রভাগের রঙ সেট করে।

পরামিতি

নামটাইপবর্ণনা
colorStringঅগ্রভাগের রঙ, CSS স্বরলিপিতে বিন্যাসিত (যেমন '#ffffff' )

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setItalic(italic)

তির্যক সেটিং সেট করে।

পরামিতি

নামটাইপবর্ণনা
italicBooleanতির্যক সেটিং

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setItalic(startOffset, endOffsetInclusive, italic)

নির্দিষ্ট অক্ষর পরিসরের জন্য তির্যক সেটিং সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the first 11 characters in the tab's body to italic.
const text = body.editAsText().setItalic(0, 10, true);

পরামিতি

নামটাইপবর্ণনা
startOffsetIntegerটেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusiveIntegerপাঠ্য পরিসরের শেষ অফসেট।
italicBooleanতির্যক সেটিং।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setLinkUrl(startOffset, endOffsetInclusive, url)

নির্দিষ্ট অক্ষর পরিসরের জন্য লিঙ্ক URL সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Applies a link to the first 11 characters in the body.
const text = body.editAsText().setLinkUrl(0, 10, 'https://example.com');

পরামিতি

নামটাইপবর্ণনা
startOffsetIntegerটেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusiveIntegerপাঠ্য পরিসরের শেষ অফসেট।
urlStringলিঙ্ক URL.

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setLinkUrl(url)

লিঙ্ক url সেট করে।

পরামিতি

নামটাইপবর্ণনা
urlStringলিঙ্ক url

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setStrikethrough(strikethrough)

স্ট্রাইকথ্রু সেটিং সেট করে।

পরামিতি

নামটাইপবর্ণনা
strikethroughBooleanস্ট্রাইকথ্রু সেটিং

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setStrikethrough(startOffset, endOffsetInclusive, strikethrough)

নির্দিষ্ট অক্ষর পরিসরের জন্য স্ট্রাইকথ্রু সেটিং সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the first 11 characters in the tab's body to strikethrough.
const text = body.editAsText().setStrikethrough(0, 10, true);

পরামিতি

নামটাইপবর্ণনা
startOffsetIntegerটেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusiveIntegerপাঠ্য পরিসরের শেষ অফসেট।
strikethroughBooleanস্ট্রাইকথ্রু সেটিং।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setText(text)

পাঠ্য বিষয়বস্তু সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Replaces the contents of the body with the text, 'New body text.'
const text = body.editAsText().setText('New body text.');

পরামিতি

নামটাইপবর্ণনা
textStringনতুন পাঠ্য বিষয়বস্তু.

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setTextAlignment(startOffset, endOffsetInclusive, textAlignment)

একটি প্রদত্ত অক্ষর পরিসরের জন্য পাঠ্য সারিবদ্ধকরণ সেট করে। সারিবদ্ধকরণের উপলব্ধ প্রকারগুলি হল DocumentApp.TextAlignment.NORMAL , DocumentApp.TextAlignment.SUBSCRIPT , এবং DocumentApp.TextAlignment.SUPERSCRIPT

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

পরামিতি

নামটাইপবর্ণনা
startOffsetIntegerঅক্ষর পরিসরের শুরু অফসেট।
endOffsetInclusiveIntegerঅক্ষর পরিসরের শেষ অফসেট (অন্তর্ভুক্ত)।
textAlignmentTextAlignmentপ্রযোজ্য পাঠ্য প্রান্তিককরণের ধরন।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

  • 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প্রযোজ্য পাঠ্য প্রান্তিককরণের ধরন

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setUnderline(underline)

আন্ডারলাইন সেটিং সেট করে।

পরামিতি

নামটাইপবর্ণনা
underlineBooleanআন্ডারলাইন সেটিং

প্রত্যাবর্তন

Text - বর্তমান উপাদান

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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

setUnderline(startOffset, endOffsetInclusive, underline)

নির্দিষ্ট অক্ষর পরিসরের জন্য আন্ডারলাইন সেটিং সেট করে।

// Opens the Docs file by its URL. If you created your script from within a
// Google Docs file, you can use DocumentApp.getActiveDocument() instead.
// TODO(developer): Replace the URL with your own.
const doc = DocumentApp.openByUrl('https://docs.google.com/document/d/DOCUMENT_ID/edit');

// Gets the body contents of the tab by its ID.
// TODO(developer): Replace the ID with your own.
const body = doc.getTab(TAB_ID).asDocumentTab().getBody();

// Sets the first 11 characters in the tab's body to underline.
const text = body.editAsText().setUnderline(0, 10, true);

পরামিতি

নামটাইপবর্ণনা
startOffsetIntegerটেক্সট ব্যাপ্তির শুরু অফসেট.
endOffsetInclusiveIntegerপাঠ্য পরিসরের শেষ অফসেট।
underlineBooleanআন্ডারলাইন সেটিং।

প্রত্যাবর্তন

Text - বর্তমান উপাদান।

অনুমোদন

যে স্ক্রিপ্টগুলি এই পদ্ধতিটি ব্যবহার করে তাদের নিম্নলিখিত এক বা একাধিক সুযোগের সাথে অনুমোদনের প্রয়োজন হয়:

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