Excel VBA for creating numbered list in Word
问题 I am trying to use VBA code in Excel to create a numbered list in a Word document. Dim wrdApp As Word.Application Dim wrdDoc As Word.Document Set wrdApp = CreateObject("Word.Application") wrdApp.Visible = True Set wrdDoc = wrdApp.Documents.Add With wrdDoc For i = 0 To 5 .Content.InsertAfter ("Paragraph " & i) .Content.InsertParagraphAfter Next .Paragraphs(1).Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _ ListGalleries(wdNumberGallery).ListTemplates(1), ContinuePreviousList:= _