利用activex从matlab中创建Word列表

利用activex从matlab中创建Word列表,matlab,ms-word,activex,Matlab,Ms Word,Activex,我是一个在matlab中使用activex控件的新手。我正在尝试控制word文档。我需要有关如何在word文档中创建列表的帮助。我在word中录制了以下宏。这是我想从Matlab中做的。非常感谢你的帮助 With ListGalleries(wdBulletGallery).ListTemplates(1).ListLevels(1) .NumberFormat = ChrW(61623) .TrailingCharacter = wdTrailingTab .Numbe

我是一个在matlab中使用activex控件的新手。我正在尝试控制word文档。我需要有关如何在word文档中创建列表的帮助。我在word中录制了以下宏。这是我想从Matlab中做的。非常感谢你的帮助

With ListGalleries(wdBulletGallery).ListTemplates(1).ListLevels(1)
    .NumberFormat = ChrW(61623)
    .TrailingCharacter = wdTrailingTab
    .NumberStyle = wdListNumberStyleBullet
    .NumberPosition = InchesToPoints(0.25)
    .Alignment = wdListLevelAlignLeft
    .TextPosition = InchesToPoints(0.5)
    .TabPosition = wdUndefined
    .ResetOnHigher = 0
    .StartAt = 1
    With .Font
        .Bold = wdUndefined
        .Italic = wdUndefined
        .StrikeThrough = wdUndefined
        .Subscript = wdUndefined
        .Superscript = wdUndefined
        .Shadow = wdUndefined
        .Outline = wdUndefined
        .Emboss = wdUndefined
        .Engrave = wdUndefined
        .AllCaps = wdUndefined
        .Hidden = wdUndefined
        .Underline = wdUndefined
        .Color = wdUndefined
        .Size = wdUndefined
        .Animation = wdUndefined
        .DoubleStrikeThrough = wdUndefined
        .Name = "Symbol"
    End With
    .LinkedStyle = ""
End With
ListGalleries(wdBulletGallery).ListTemplates(1).Name = ""
Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
    ListGalleries(wdBulletGallery).ListTemplates(1), ContinuePreviousList:= _
    False, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _
    wdWord10ListBehavior
Selection.TypeText Text:="asasasasasasas"
Selection.TypeParagraph
Selection.TypeText Text:="asasasasasasas"
Selection.TypeParagraph

End Sub

我设法找到了一个解决方案,为那些需要它的人发布

word=actxserver('word.application');
word.Visible=true;
myDoc=word.Documents.Add();
listTemp1=myDoc.ActiveWindow.Selection.Range.Application.ListGalleries.Item(2).ListTemplates.Item(1);
listTemp1.ListLevels.Item(1).NumberStyle=1;      
myDoc.ActiveWindow.Selection.Range.ListFormat.ApplyListTemplate(listTemp1,0,0,2);