একটি উপাদান যা একজন ব্যক্তির লিঙ্ককে প্রতিনিধিত্ব করে। একটি ব্যক্তির লিঙ্ক একটি ইমেল ঠিকানাকে বোঝায় এবং ঐচ্ছিকভাবে ঠিকানার সাথে একটি নাম যুক্ত থাকতে পারে। যদি নামটি সেট করা থাকে, তাহলে নামটিই ডকুমেন্টের মূল অংশে প্রদর্শিত হয়।
পদ্ধতি
| পদ্ধতি | রিটার্ন টাইপ | সংক্ষিপ্ত বিবরণ |
|---|---|---|
copy() | Person | বর্তমান এলিমেন্টের একটি বিচ্ছিন্ন, গভীর অনুলিপি প্রদান করে। |
get Attributes() | Object | উপাদানের বৈশিষ্ট্যগুলি পুনরুদ্ধার করে। |
get Email() | String | ব্যক্তির ইমেল ঠিকানা ফেরত দেয়। |
get Name() | String|null | যদি সেট করা থাকে, তাহলে ব্যক্তির প্রদর্শন নাম ফেরত দেয়। |
get Next Sibling() | Element |null | এলিমেন্টের পরবর্তী সিবলিং এলিমেন্ট উদ্ধার করে। |
get Parent() | Container Element |null | এলিমেন্টের প্যারেন্ট এলিমেন্ট উদ্ধার করে। |
get Previous Sibling() | Element |null | এলিমেন্টের পূর্ববর্তী ভাইবোন এলিমেন্ট উদ্ধার করে। |
get Type() | Element Type | উপাদানটির Element Type উদ্ধার করে। |
is At Document End() | Boolean | উপাদানটি Document শেষে আছে কিনা তা নির্ধারণ করে। |
merge() | Person |null | একই ধরণের পূর্ববর্তী ভাইবোনের সাথে উপাদানটিকে মার্জ করে। |
remove From Parent() | Person |null | উপাদানটিকে তার মূল উপাদান থেকে সরিয়ে দেয়। |
set Attributes(attributes) | Person | এলিমেন্টের বৈশিষ্ট্য নির্ধারণ করে। |
বিস্তারিত ডকুমেন্টেশন
copy()
বর্তমান এলিমেন্টের একটি বিচ্ছিন্ন, গভীর অনুলিপি প্রদান করে।
এলিমেন্টে উপস্থিত যেকোনো চাইল্ড এলিমেন্টও কপি করা হয়। নতুন এলিমেন্টের কোন প্যারেন্ট নেই।
প্রত্যাবর্তন
Person — নতুন কপি।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Attributes()
উপাদানের বৈশিষ্ট্যগুলি পুনরুদ্ধার করে।
ফলাফল হল প্রতিটি বৈধ উপাদান বৈশিষ্ট্যের জন্য একটি বৈশিষ্ট্য ধারণকারী একটি বস্তু যেখানে প্রতিটি বৈশিষ্ট্যের নাম Document App.Attribute একটি আইটেমের সাথে মিলে যায়। অ্যাট্রিবিউট গণনা।
const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody(); // Append a styled paragraph. const par = body.appendParagraph('A bold, italicized paragraph.'); par.setBold(true); par.setItalic(true); // Retrieve the paragraph's attributes. const atts = par.getAttributes(); // Log the paragraph attributes. for (const att in atts) { Logger.log(`${att}:${atts[att]}`); }
প্রত্যাবর্তন
Object — উপাদানের বৈশিষ্ট্য।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Email()
ব্যক্তির ইমেল ঠিকানা ফেরত দেয়।
প্রত্যাবর্তন
String — ব্যক্তির ইমেল ঠিকানা।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Name()
যদি সেট করা থাকে, তাহলে ব্যক্তির প্রদর্শন নাম ফেরত দেয়।
প্রত্যাবর্তন
String|null — ব্যক্তির লিঙ্কের প্রদর্শন নাম, অথবা যদি উপাদানটি ইমেল ঠিকানা প্রদর্শন করে তবে null ।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Next Sibling()
এলিমেন্টের পরবর্তী সিবলিং এলিমেন্ট উদ্ধার করে।
পরবর্তী ভাইবোনের একই পিতামাতা আছে এবং বর্তমান উপাদানটি অনুসরণ করে।
প্রত্যাবর্তন
Element |null — পরবর্তী সহোদর উপাদান।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Parent()
এলিমেন্টের প্যারেন্ট এলিমেন্ট উদ্ধার করে।
প্যারেন্ট এলিমেন্টে বর্তমান এলিমেন্ট থাকে।
প্রত্যাবর্তন
Container Element |null — মূল এলিমেন্ট।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Previous Sibling()
এলিমেন্টের পূর্ববর্তী ভাইবোন এলিমেন্ট উদ্ধার করে।
পূর্ববর্তী ভাইবোনের একই প্যারেন্ট আছে এবং বর্তমান এলিমেন্টের আগে থাকে।
প্রত্যাবর্তন
Element |null — পূর্ববর্তী সহোদর উপাদান।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
get Type()
উপাদানটির Element Type উদ্ধার করে।
একটি নির্দিষ্ট উপাদানের সঠিক ধরণ নির্ধারণ করতে get Type() ব্যবহার করুন।
const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody(); // Obtain the first element in the active tab's body. const 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.'); }
প্রত্যাবর্তন
Element Type — এলিমেন্টের ধরণ।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
is At Document End()
উপাদানটি Document শেষে আছে কিনা তা নির্ধারণ করে।
প্রত্যাবর্তন
Boolean — উপাদানটি ট্যাবের শেষে আছে কিনা।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
merge()
একই ধরণের পূর্ববর্তী ভাইবোনের সাথে উপাদানটিকে মার্জ করে।
শুধুমাত্র একই Element Type এলিমেন্টগুলিকে মার্জ করা যেতে পারে। বর্তমান এলিমেন্টে থাকা যেকোনো চাইল্ড এলিমেন্ট পূর্ববর্তী সিবলিং এলিমেন্টে স্থানান্তরিত হয়।
বর্তমান উপাদানটি ডকুমেন্ট থেকে সরানো হয়েছে।
const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody(); // Example 1: Merge paragraphs // Append two paragraphs to the document's active tab. const par1 = body.appendParagraph('Paragraph 1.'); const 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. const cells = [ ['Row 1, Cell 1', 'Row 1, Cell 2'], ['Row 2, Cell 1', 'Row 2, Cell 2'], ]; // Build a table from the array. const table = body.appendTable(cells); // Get the first row in the table. const row = table.getRow(0); // Get the two cells in this row. const cell1 = row.getCell(0); const cell2 = row.getCell(1); // Merge the current cell into its preceding sibling element. const merged = cell2.merge();
প্রত্যাবর্তন
Person |null — মার্জ করা উপাদান।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
remove From Parent()
উপাদানটিকে তার মূল উপাদান থেকে সরিয়ে দেয়।
const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody(); // Remove all images in the active tab's body. const imgs = body.getImages(); for (let i = 0; i < imgs.length; i++) { imgs[i].removeFromParent(); }
প্রত্যাবর্তন
Person |null — সরানো উপাদান।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents
set Attributes(attributes)
এলিমেন্টের বৈশিষ্ট্য নির্ধারণ করে।
নির্দিষ্ট অ্যাট্রিবিউট প্যারামিটারটি অবশ্যই এমন একটি অবজেক্ট হতে হবে যেখানে প্রতিটি প্রোপার্টির নাম Document App.Attribute একটি আইটেম। অ্যাট্রিবিউট গণনা এবং প্রতিটি প্রোপার্টির মান হল প্রয়োগ করা নতুন মান।
const doc = DocumentApp.getActiveDocument(); const documentTab = doc.getActiveTab().asDocumentTab(); const body = documentTab.getBody(); // Define a custom paragraph style. const 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. const par = body.appendParagraph('A paragraph with custom style.'); // Apply the custom style. par.setAttributes(style);
পরামিতি
| নাম | আদর্শ | বিবরণ |
|---|---|---|
attributes | Object | উপাদানটির বৈশিষ্ট্য। |
প্রত্যাবর্তন
Person — বর্তমান উপাদান।
অনুমোদন
এই পদ্ধতি ব্যবহার করে এমন স্ক্রিপ্টগুলির জন্য নিম্নলিখিত এক বা একাধিক স্কোপের অনুমোদন প্রয়োজন:
-
https://www.googleapis.com/auth/documents.currentonly -
https://www.googleapis.com/auth/documents