using Microsoft.Office.Interop.Word;

// 创建 Word 应用程序对象
Application wordApp = new Application();

// 打开 Word 文档
Document doc = wordApp.Documents.Open(@"C:\Test.docx");

// 获取项目列表
ListGalleries galleries = doc.ListGalleries;

// 继续编号
galleries[Word.WdListGalleryType.wdNumberGallery].ListTemplates[1].ContinuePreviousListNumbering();
using Microsoft.Office.Interop.Word;

// 创建 Word 应用程序对象
Application wordApp = new Application();

// 打开 Word 文档
Document doc = wordApp.Documents.Open(@"C:\Test.docx");

// 获取项目列表
ListGalleries galleries = doc.ListGalleries;

// 继续编号
galleries[Word.WdListGalleryType.wdNumberGallery].ListTemplates[2].ContinuePreviousListNumbering();
using Microsoft.Office.Interop.Word;

// 创建 Word 应用程序对象
Application wordApp = new Application();

// 打开 Word 文档
Document doc = wordApp.Documents.Open(@"C:\Test.docx");

// 获取项目列表
ListGalleries galleries = doc.ListGalleries;

// 继续编号
galleries[Word.WdListGalleryType.wdNumberGallery].ListTemplates[3].ContinuePreviousListNumbering();
using Microsoft.Office.Interop.Word;

// 创建 Word 应用程序对象
Application wordApp = new Application();

// 打开 Word 文档
Document doc = wordApp.Documents.Open(@"C:\Test.docx");

// 获取项目列表
ListGalleries galleries = doc.ListGalleries;

// 继续编号
galleries[Word.WdListGalleryType.wdNumberGallery].ListTemplates[4].ContinuePreviousListNumbering();
using Microsoft.Office.Interop.Word;

// 创建 Word 应用程序对象
Application wordApp = new Application();

// 打开 Word 文档
Document doc = wordApp.Documents.Open(@"C:\Test.docx");

// 获取项目列表
ListGalleries galleries = doc.ListGalleries;

// 继续编号
galleries[Word.WdListGalleryType.wdNumberGallery].ListTemplates[5].ContinuePreviousListNumbering();
``
请用C#写出5种用Interopword 项目列表ListGalleries继续编号代码

原文地址: https://www.cveoy.top/t/topic/hxtb 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录