G
Greig Mackenzie
Hi,
I have read so many posts and threads now that I really don't know which way
to turn.
I used to run a macro that would find and then reapply a numbered style and
then (as applicable) restart the number by specifying the correct ListTemp
and ListLvl and ContinuePreviousList:=False. For obvious reasons this only
really worked for me--many people's ListTemp 4 had changed. I could get
documents, fix them and then give them back and they usually stayed fine, at
least for a while.
So many documents in this company are re-used, bits copied and pasted, etc.
Corruption issues abounded. I have stemmed most of these but not all--too
many ListTemplates seems tp be the issue now (i.e., >1700).
Hence, I now have several different numbering schemes that have been created
and attached to paragraph styles using the certified VB code method in these
posts (happened to be Dave Rado's version in this case I believe). Works
beautifully to standardise formatting for my 7 different ListTemplates (all
Outline) for both Templates and any document that goes awry. BTW Thank You
everyone.
I have a macro that will find the most typical circumstances in which List
Numbers should start from 1, i.e., after certain headings, after my ListPre
style, etc. The problem is that, instead of specifying the ListTemp and
ListLvl, I want to specify 'ListNumberTemplate' and the ListLvl. But I can't
work out how to substitute, 'ListNumberTemplate' for ListTemp=X.
Eg.
Sub ResetListNumber4()
' List Number 4
Selection.Style = ActiveDocument.Styles( _
"List Number 4,LN4")
LISTTEMP = 3 'List Gallery Template 0-7
LISTLVL = 4 'List Level 1-9
' With
ListGalleries(wdOutlineNumberGallery).ListTemplates(LISTTEMP).ListLevels(LIS
TLVL)
' .StartAt = 1
' .LinkedStyle = "List Number 4,LN4"
' End With
ListGalleries(wdOutlineNumberGallery).ListTemplates(LISTTEMP).Name = ""
Selection.Range.ListFormat.ApplyListTemplate
ListTemplate:=ListGalleries( _
wdOutlineNumberGallery).ListTemplates(LISTTEMP),
ContinuePreviousList:=False, _
ApplyTo:=wdListApplyToWholeList,
DefaultListBehavior:=wdWord9ListBehavior
End Sub
I tried a change as follows, (showing my ignorance):
ListGalleries(wdOutlineNumberGallery).ListTemplates().Name =
"ListNumberTemplate"
It didn't like it. Or it didn't do anything.
Since I can determine the restart point of 80% of our lists, I want to just
run a macro that will restart the selected paragraph using either the
existing or a specified named ListTemplate.
Also, (and this may be incorporated into an existing 'seek and restart'
macro) I would like to be able to just restart the selected paragraph,
referencing the attached ListTemplate while KEEPING the attached
ListTemplate.
The following only worked for me for level 1. I need to be able to
discriminate between levels and reset only that level for the current
paragraph:
Dim myLT As ListTemplate
Set myLT = ActiveDocument.ListTemplates("ListNumberTemplate")
Selection.Range.ListFormat.ApplyListTemplate _
ListTemplate:=myLT, _
ContinuePreviousList:=False, _
ApplyTo:=wdListApplyToWholeList, _
DefaultListBehavior:=wdWord9ListBehavior
Can anybody understand what I am trying to do?
For commonly posted reasons, I want to avoid LISTNUM and Dummy Styles. My
best bet for this place is to provide a couple of buttons (macros) that will
Restart (selected) or Continue (selected), using whatever ListTemplate and
ListLvl is attached (these can be predefined/fixed by other methods)
I hope I have explained myself adequately.
Thanks in advance for any help
Greig Mackenzie
I have read so many posts and threads now that I really don't know which way
to turn.
I used to run a macro that would find and then reapply a numbered style and
then (as applicable) restart the number by specifying the correct ListTemp
and ListLvl and ContinuePreviousList:=False. For obvious reasons this only
really worked for me--many people's ListTemp 4 had changed. I could get
documents, fix them and then give them back and they usually stayed fine, at
least for a while.
So many documents in this company are re-used, bits copied and pasted, etc.
Corruption issues abounded. I have stemmed most of these but not all--too
many ListTemplates seems tp be the issue now (i.e., >1700).
Hence, I now have several different numbering schemes that have been created
and attached to paragraph styles using the certified VB code method in these
posts (happened to be Dave Rado's version in this case I believe). Works
beautifully to standardise formatting for my 7 different ListTemplates (all
Outline) for both Templates and any document that goes awry. BTW Thank You
everyone.
I have a macro that will find the most typical circumstances in which List
Numbers should start from 1, i.e., after certain headings, after my ListPre
style, etc. The problem is that, instead of specifying the ListTemp and
ListLvl, I want to specify 'ListNumberTemplate' and the ListLvl. But I can't
work out how to substitute, 'ListNumberTemplate' for ListTemp=X.
Eg.
Sub ResetListNumber4()
' List Number 4
Selection.Style = ActiveDocument.Styles( _
"List Number 4,LN4")
LISTTEMP = 3 'List Gallery Template 0-7
LISTLVL = 4 'List Level 1-9
' With
ListGalleries(wdOutlineNumberGallery).ListTemplates(LISTTEMP).ListLevels(LIS
TLVL)
' .StartAt = 1
' .LinkedStyle = "List Number 4,LN4"
' End With
ListGalleries(wdOutlineNumberGallery).ListTemplates(LISTTEMP).Name = ""
Selection.Range.ListFormat.ApplyListTemplate
ListTemplate:=ListGalleries( _
wdOutlineNumberGallery).ListTemplates(LISTTEMP),
ContinuePreviousList:=False, _
ApplyTo:=wdListApplyToWholeList,
DefaultListBehavior:=wdWord9ListBehavior
End Sub
I tried a change as follows, (showing my ignorance):
ListGalleries(wdOutlineNumberGallery).ListTemplates().Name =
"ListNumberTemplate"
It didn't like it. Or it didn't do anything.
Since I can determine the restart point of 80% of our lists, I want to just
run a macro that will restart the selected paragraph using either the
existing or a specified named ListTemplate.
Also, (and this may be incorporated into an existing 'seek and restart'
macro) I would like to be able to just restart the selected paragraph,
referencing the attached ListTemplate while KEEPING the attached
ListTemplate.
The following only worked for me for level 1. I need to be able to
discriminate between levels and reset only that level for the current
paragraph:
Dim myLT As ListTemplate
Set myLT = ActiveDocument.ListTemplates("ListNumberTemplate")
Selection.Range.ListFormat.ApplyListTemplate _
ListTemplate:=myLT, _
ContinuePreviousList:=False, _
ApplyTo:=wdListApplyToWholeList, _
DefaultListBehavior:=wdWord9ListBehavior
Can anybody understand what I am trying to do?
For commonly posted reasons, I want to avoid LISTNUM and Dummy Styles. My
best bet for this place is to provide a couple of buttons (macros) that will
Restart (selected) or Continue (selected), using whatever ListTemplate and
ListLvl is attached (these can be predefined/fixed by other methods)
I hope I have explained myself adequately.
Thanks in advance for any help
Greig Mackenzie