View Single Post
 
Old 09-11-2023, 08:11 PM
Journeyman Journeyman is offline Windows 10 Office 2019
Novice
 
Join Date: Feb 2023
Posts: 15
Journeyman is on a distinguished road
Default Restarting a List

Hi All,

I am inserting an HTML file into a word table
Code:
    Set rngTarget = Mod_Tables.WrdTbl3.Cell(1, 1).Range
    Set FSO = CreateObject("Scripting.FileSystemObject")
    strTempFile = FSO.getspecialfolder(2) & "\" & FSO.GetTempName & ".htm"
    Set f = FSO.createtextfile(strTempFile, True)
    f.write strHTMLText
    f.Close
    Set f = Nothing
    rngTarget.InsertFile strTempFile

Easy enough. The above inserts the HTML file directly into the place I need it, however, the HTML output contains lists. And when it dumps the file into the document the list continues from its previous list.

So after a bit of hunting I found something like this:

Code:
Dim aList As ListFormat
Set aList = rngTarget.ListFormat
aList.ApplyListTemplate ListTemplate:=aList.ListTemplate, ContinuePreviousList:=False
This is not right. The first problem is that I need to identify the first list item, and make it continuous. not every item.

I can loop every para in the table, but how can I know it's the first list item and how can I reset it to 1?

Thanks in advance.
Reply With Quote