请用C#写出5种word 项目列表ListGalleries继续编号代码
- 使用Microsoft.Office.Interop.Word命名空间:
using Microsoft.Office.Interop.Word;
Application wordApp = new Application();
ListGalleries listGalleries = wordApp.ListGalleries;
int count = listGalleries.Count;
- 使用Open XML SDK:
using DocumentFormat.OpenXml.Wordprocessing;
using (WordprocessingDocument wordDoc = WordprocessingDocument.Open("Document.docx", true))
{
ListGallery listGallery = wordDoc.MainDocumentPart.DocumentSettingsPart.Settings.Descendants<ListGallery>().FirstOrDefault();
int count = listGallery.Count;
}
- 使用Aspose.Words:
using Aspose.Words;
Document doc = new Document("Document.docx");
ListGalleries listGalleries = doc.ListGalleries;
int count = listGalleries.Count;
- 使用Spire.Doc:
using Spire.Doc;
Document doc = new Document();
ListGallery listGallery = doc.ListGalleries;
int count = listGallery.Count;
- 使用GemBox.Document:
using GemBox.Document;
DocumentModel document = DocumentModel.Load("Document.docx");
ListGallery listGallery = document.Settings.ListGallery;
int count = listGallery.Count;
``
原文地址: https://www.cveoy.top/t/topic/hxs8 著作权归作者所有。请勿转载和采集!