مشاركة عبر


DocumentBase.ListTemplates الخاصية

يحصل ListTemplatesالمجموعة التي تمثل قائمة بالجميع التنسيقات للتطبيق.

مساحة الاسم:  Microsoft.Office.Tools.Word
التجميع:  Microsoft.Office.Tools.Word.v4.0.Utilities (في Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

بناء الجملة

'إقرار
Public ReadOnly Property ListTemplates As ListTemplates
    Get
public ListTemplates ListTemplates { get; }

قيمة الخاصية

النوع: Microsoft.Office.Interop.Word.ListTemplates
ListTemplatesمجموعة يمثل الجميع القائمة تنسيق مستند.

أمثلة

يلي تعليمات برمجية المثال إضافة نص إلى اﻷول نمطين الفقرات بتطبيق قالب قائمة للفقرات وثم يقوم بعرض رسالة تقوم بإظهار عدد القوائم في مستند. إلى لاستخدام هذا المثال، قم بتشغيلها من ThisDocumentالفئة في مشروع المستوى مستند.

Private Sub DocumentLists()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Me.Paragraphs(1).Range.InsertParagraphAfter()

    Me.Paragraphs(1).Range.Text = "This is the first paragraph."
    Me.Paragraphs(2).Range.Text = "This is the second paragraph."

    Dim Start As Object = Me.Paragraphs(1).Range.Start
    Dim [End] As Object = Me.Paragraphs(2).Range.End
    Dim myRange As Word.Range = Me.Range(Start, [End])
    Dim index As Object = 1

    Dim myTemplate As Word.ListTemplate = Application.ListGalleries( _
        Microsoft.Office.Interop.Word.WdListGalleryType.wdNumberGallery). _
        ListTemplates.Item(index)

    myRange.ListFormat.ApplyListTemplate(myTemplate)

    MessageBox.Show("Total lists in document: " & Me.Lists.Count.ToString())
End Sub 
private void DocumentLists()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    this.Paragraphs[1].Range.InsertParagraphAfter();


    this.Paragraphs[1].Range.Text = "This is the first paragraph.";
    this.Paragraphs[2].Range.Text = "This is the second paragraph.";

    object Start = this.Paragraphs[1].Range.Start;
    object End = this.Paragraphs[2].Range.End;
    Word.Range myRange = this.Range(ref Start,
        ref End);
    object index = 1;

    Word.ListTemplate myTemplate = Application.ListGalleries[Microsoft.Office.Interop.Word.WdListGalleryType.wdNumberGallery].ListTemplates.get_Item(ref index);

    myRange.ListFormat.ApplyListTemplate(myTemplate, 
        ref missing, ref missing, ref missing);

    MessageBox.Show ("Total lists in document: " +
        this.Lists.Count.ToString());

}

أمن NET Framework.

راجع أيضًَا

المرجع

DocumentBase الفئة

DocumentBase الأعضاء

Microsoft.Office.Tools.Word مساحة الاسم