Outline List Template numbering changes with another computer

M

MLBeck

I followed the Shauna Kelly rules for setting up numbering for my
template. (I picked one Outline List Template and set all subsequent
headings from there and linked them to the appropriate heading
styles.
And I named my list template.)

The template has user forms for soliciting info from the User,
including the number that Heading 1 should start at. The template
macros take this and start Heading 1 at that number (e.g.," 4," then
Heading 2 should be "4.1" and Heading 3 should be "4.1.1"). This
template works for me, but when my coworker tried creating a document
from the template, his Heading 1 set correctly (in this case as a
"9") but then his Heading 2 was "3.1" and his Heading 3 was "3.1.1."


He emailed the document back to me and and I found that his Headings
2
and 3 were no longer linked to the same List Template as Heading 1.
Is
this due to an error I have made in my template numbering set up or
should I look elsewhere for the cause?
 
M

MLBeck

Actually, I thought it worked for me, but I am finding several
glitches. The code below is fired when the code for my OK button
reaches this particular step.

Here are several things that go wrong when I run the template (and
they appear to be different things than those my colleague
experiences):
1. My Heading1 paragraph takes on the format of Heading 2. (The
Heading1 style is still ok and I was able to re-Style the text.
2. Heading2 and Heading3 are ok.
3. Listlevel 4 was linked to my ListNumber (so it would restart after
Heading2), but when I produce a document, ListLevel 4 is unlinked and
is back to it's outline numbering ways (eg." 4.1.1.1" when it is just
supposed to be "1.") Is my code restarting the ListTemplate
someway---
Ahhh, it is dawning on me that I need to reset every item in the List
Template when I run the macro not just the Heading 1. I will try
rewriting my code and testing that. Meanwhile, if anyone has any other
suggestions, I would be most pleased to hear them--especially why
Heading1 text won't format with the Heading1 style.



Public Sub UpdateHeading1()
'

Dim rngHead1 As Range

Set rngHead1 = ActiveDocument.Bookmarks("bHead1").Range


If ActiveDocument.Bookmarks.Exists("bHead1") = False Then 'If it
doesn't exist
'Add the bookmark to the first heading 1
'Find which paragraph has a heading 1
With ActiveDocument.Content.Find 'Find the page break
.ClearFormatting
.Style = wdStyleHeading1

.text = ""
.Execute

If .Found = True Then
.Parent.Select
Selection.Range.Bookmarks.Add Name:="bHead1"
End If

End With
'
Else
End If

With
ListGalleries(wdOutlineNumberGallery).ListTemplates(1).ListLevels(1)
.NumberFormat = "%1"
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleArabic
.NumberPosition = InchesToPoints(0)
.Alignment = wdListLevelAlignLeft

.StartAt = strSecNum
.LinkedStyle = "Heading 1"
End With


ListGalleries(wdOutlineNumberGallery).ListTemplates(1).Name =
"D&C"
ActiveDocument.Styles("Heading 1").LinkToListTemplate
ListTemplate:= _
ListGalleries(wdOutlineNumberGallery).ListTemplates(1),
ListLevelNumber:= _
1
With ActiveDocument.Styles("Heading 1")
.AutomaticallyUpdate = False
.BaseStyle = ""
.NextParagraphStyle = "Body Text"
End With

rngHead1.text = strSectionTitle
rngHead1.Select
'Reinsert the bookmark
ActiveDocument.Bookmarks.Add "bHead1", rngHead1

End Sub
 
M

MLBeck

Yes, that was my problem. I was just trying to reset the one ListLevel
and I needed to reset them all whenever I ran the macro.

I am still having trouble getting the Heading1 level to take on the
Heading1 style.

I have tried

rngHead1.text = strSectionTitle
rngHead1.Select
rngHead1.Style = ActiveDocument.Styles("Heading 1")
'Reinsert the bookmark
ActiveDocument.Bookmarks.Add "bHead1", rngHead1

AND

rngHead1.text = strSectionTitle
rngHead1.Select
'Reinsert the bookmark
ActiveDocument.Bookmarks.Add "bHead1", rngHead1
ActiveDocument.Bookmarks("bHead1").Range.Style =
ActiveDocument.Styles("Heading 1")

and to no avail. If I can select the bookmark where the text resides,
why can't I get it to restyle as Heading1?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top