Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a large document that is automatically created, however the numbering style isn't getting set right...

 

Here's some of the code I'm trying:

 

	
Dim oP As Object ' Word.Paragraph
Dim x As Object ' Word.ListTemplate
x = m_objWordApp.ListGalleries.Item(3).ListTemplates.I  tem(4)

Try
For Each oP In m_objBaseDoc.listparagraphs
    If oP.Range.ListFormat.ListType = 0 Then	 ' wdListNoNumbering
	    oP.Range.ListFormat.ApplyOutlineNumberDefault()
   	     End If
    oP.Range.ListFormat.ApplyListTemplate(x, False)
Next

 

 

The line with .ApplyListFormat is causing it to break, it says Type Mismatch on x. I am trying to enforce that the list is set with the 3rd outnline numbering method, so my items are like 1.0, 1.1.1, 1.1.2.3, etc...

 

While at it, I'm also trying to get the lines to indent properly. When I send a vbTab it indents the text, but doesn't indent the list level.. ie: if indenting the second item, it would appear:

2.0 text

instead of

1.1 text

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...