EXCEL -> WORD Creating Outline HELP

business_analyst

Board Regular
Joined
Jun 5, 2009
Messages
99
Hey All,

so I am sending some text from excel to a word document. I would like to create an Outline list for this information with two levels:
1)
a.
I know how to create a regular list, but I have no idea how to tell word to execute the second list level! This is the code I have right now:

Code:
Sub CreateNewWordDoc()

Dim wrdApp As Object
Dim wrdDoc As Object
Dim textvar As String

    Set wrdApp = CreateObject("Word.Application.11")
    wrdApp.Visible = True
    Set wrdDoc = wrdApp.Documents.Add

With wrdApp.Selection
    .Range.ListFormat.ApplyListTemplate ListTemplate:=wrdApp.ListGalleries(wdOutlineNumberGallery).ListTemplates(1), ContinuePreviousList:=False, ApplyTo:= _
        wdListApplyToWholeList, DefaultListBehavior:=wdWord10ListBehavior

    .TypeText Text:="First line with level one"
    .TypeParagraph

    .Range.ListFormat.RemoveNumbers NumberType:=wdNumberParagraph
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,215,591
Messages
6,125,711
Members
449,252
Latest member
cryss1988

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top