DocumentBase.Sections الخاصية
يحصل Sectionsمجموعة الذي يمثل المقاطع في مستند.
مساحة الاسم: Microsoft.Office.Tools.Word
التجميع: Microsoft.Office.Tools.Word.v4.0.Utilities (في Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
بناء الجملة
'إقرار
Public ReadOnly Property Sections As Sections
Get
public Sections Sections { get; }
قيمة الخاصية
النوع: Microsoft.Office.Interop.Word.Sections
Sectionsمجموعة الذي يمثل المقاطع في مستند.
أمثلة
يلي تعليمات برمجية المثال إضافة نص إلى الفقرة الأولى في مستند ويقوم بإضافة مقطع جديد قبل النص. إلى لاستخدام هذا المثال، قم بتشغيلها من ThisDocumentالفئة في مشروع المستوى مستند.
Private Sub DocumentSections()
Me.Paragraphs(1).Range.InsertParagraphBefore()
Me.Paragraphs(1).Range.Text = "This is sample text."
Dim Range As Object = Me.Paragraphs(1).Range
Me.Sections.Add(Range)
End Sub
private void DocumentSections()
{
this.Paragraphs[1].Range.InsertParagraphBefore();
this.Paragraphs[1].Range.Text = "This is sample text.";
object Range = this.Paragraphs[1].Range;
this.Sections.Add(ref Range, ref missing);
}
أمن NET Framework.
- الثقة الكاملة للمتصل الفوري. يتعذر استخدام هذا العضو بواسطة التعليمات البرمجية الموثوق بها جزئيًا. لمزيد من المعلومات، راجع باستخدام مكتبات من تعليمات برمجية موثوق بها جزئي.