以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  word VBA 控制项目列表  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=185601)

--  作者:tld
--  发布时间:2023/3/4 18:19:00
--  word VBA 控制项目列表
老师好,我用word VBA控制项目列表,代码如下:
    Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
        ListGalleries(wdNumberGallery).ListTemplates(1), ContinuePreviousList:= _
        False, ApplyTo:=wdListApplyToSelection, DefaultListBehavior:= _
        wdWord10ListBehavior

图片点击可在新窗口打开查看此主题相关图片如下:捕获 (2).png
图片点击可在新窗口打开查看


VBA代码可实现将科目表 一行前面添加编号。如何用狐表实现呢?谢谢老师
Dim app As New MSWord.Application
Dim doc = app.Documents.Open("e:\\Word.docx")
app.Visible = True
------------------------


--  作者:有点蓝
--  发布时间:2023/3/5 20:27:00
--  
app.Selection.Range.ListFormat.ApplyListTemplateWithLevel(MSWord.ListGalleries(MSWord.WdListGalleryType.wdNumberGallery).ListTemplates(1), False, MSWord.WdListApplyTo.wdListApplyToSelection, MSWord.WdDefaultListBehavior.wdWord10ListBehavior)