C
CJ
Heres a good one to chew on...
There are occasions when we want to separate out the Statutes category into
two separate categories, "federal statutes" and "state statutes", because
Word doesn't recognize that federal statutes must appear before state
statutes, and we don't want to run the risk of manually moving the federal up
before the state and then updating the table of authorities and forgetting to
do the manual work again.
Here's my issue:
I have macro that reassigns categories 2 through 8, essentially renaming
Statutes and Other Authorities, and then just dropping Other Authorities
through Constituational Provisions down one level.
This is only to work if the attached template is one of four templates,
otherwise it is to leave everything alone and quit. What is happening is
that it is changing the normal.dot anyway.
Is there any way to not have normal.dot be changed? I can program it so it
will put the categories back to Word's default categories, but if someone has
already modified their categories in normal.dot, I don't want to mess with
that.
Here's my code, help mucho appreciated, please!
Sub TOASplitStatutes()
'
' splits federal and state statutes out, state statutes takes the
'place of level 3 "other authorities", and then all other
'categories drop down one level only if certain templates are attached
'BUT IT STILL CHANGES NORMAL! NEED FIX
Dim objAD As Document
Dim strTplt As String
Set objAD = ActiveDocument
strTplt = objAD.AttachedTemplate
If strTplt = "SuperiorCourtBriefMaster.dot" _
Or strTplt = "DelawareSupremeCourtBriefMaster.dot" _
Or strTplt = "USSupremeCourtBriefMaster.dot" _
Or strTplt = "ChanceryCourtBriefMaster.dot" _
Or strTplt = "DistrictCourtBriefMaster.dot" Then
ActiveDocument.TablesOfAuthoritiesCategories(1).Name = "Cases"
ActiveDocument.TablesOfAuthoritiesCategories(2).Name = "Federal Statutes"
ActiveDocument.TablesOfAuthoritiesCategories(3).Name = "Delaware Statutes"
ActiveDocument.TablesOfAuthoritiesCategories(4).Name = "Other Authorities"
ActiveDocument.TablesOfAuthoritiesCategories(5).Name = "Rules"
ActiveDocument.TablesOfAuthoritiesCategories(6).Name = "Treatises"
ActiveDocument.TablesOfAuthoritiesCategories(7).Name = "Regulations"
ActiveDocument.TablesOfAuthoritiesCategories(8).Name = "Constitutional
Provisions"
Else
MsgBox ("If you want to split the TOA statutes out to" & vbNewLine &
"separate federal and state statutes, you must" & vbNewLine & "attach the
correct MorrisJames brief template first." & vbNewLine & "Attach template and
rerun the macro.")
Exit Sub
End If
Set objAD = Nothing
End Sub
There are occasions when we want to separate out the Statutes category into
two separate categories, "federal statutes" and "state statutes", because
Word doesn't recognize that federal statutes must appear before state
statutes, and we don't want to run the risk of manually moving the federal up
before the state and then updating the table of authorities and forgetting to
do the manual work again.
Here's my issue:
I have macro that reassigns categories 2 through 8, essentially renaming
Statutes and Other Authorities, and then just dropping Other Authorities
through Constituational Provisions down one level.
This is only to work if the attached template is one of four templates,
otherwise it is to leave everything alone and quit. What is happening is
that it is changing the normal.dot anyway.
Is there any way to not have normal.dot be changed? I can program it so it
will put the categories back to Word's default categories, but if someone has
already modified their categories in normal.dot, I don't want to mess with
that.
Here's my code, help mucho appreciated, please!
Sub TOASplitStatutes()
'
' splits federal and state statutes out, state statutes takes the
'place of level 3 "other authorities", and then all other
'categories drop down one level only if certain templates are attached
'BUT IT STILL CHANGES NORMAL! NEED FIX
Dim objAD As Document
Dim strTplt As String
Set objAD = ActiveDocument
strTplt = objAD.AttachedTemplate
If strTplt = "SuperiorCourtBriefMaster.dot" _
Or strTplt = "DelawareSupremeCourtBriefMaster.dot" _
Or strTplt = "USSupremeCourtBriefMaster.dot" _
Or strTplt = "ChanceryCourtBriefMaster.dot" _
Or strTplt = "DistrictCourtBriefMaster.dot" Then
ActiveDocument.TablesOfAuthoritiesCategories(1).Name = "Cases"
ActiveDocument.TablesOfAuthoritiesCategories(2).Name = "Federal Statutes"
ActiveDocument.TablesOfAuthoritiesCategories(3).Name = "Delaware Statutes"
ActiveDocument.TablesOfAuthoritiesCategories(4).Name = "Other Authorities"
ActiveDocument.TablesOfAuthoritiesCategories(5).Name = "Rules"
ActiveDocument.TablesOfAuthoritiesCategories(6).Name = "Treatises"
ActiveDocument.TablesOfAuthoritiesCategories(7).Name = "Regulations"
ActiveDocument.TablesOfAuthoritiesCategories(8).Name = "Constitutional
Provisions"
Else
MsgBox ("If you want to split the TOA statutes out to" & vbNewLine &
"separate federal and state statutes, you must" & vbNewLine & "attach the
correct MorrisJames brief template first." & vbNewLine & "Attach template and
rerun the macro.")
Exit Sub
End If
Set objAD = Nothing
End Sub