You can Add your own template using VB, or let Word add one for you whenever
you modify a list.
So how do they get cleaned out when they are no longer used.
I have written a script to list all the document-embedded templates, and now
I want to clean out
all the unused occurrences. But therein lies the problem, I can't seem to
find a Delete function.
Can anybody help ?
:o)
Yup - they are maximum screwy. Nope, yer cannot delete em. SOMETIMES
you get reductions by reapply a listtemplate of Nothing to style lines
that shouldn't have em.
Sometimes you can get reductions doing a cutten paste everything but
the last para.
My last hope for complete success in this area is to completely
rebuild a document using a macro :-(
Steve H
Steve Hudson , HDK List MVP
Wright Technologies Pty Ltd (Aus) EyeSpring - the future of graphics has been created.
Word New User FAQ & Web Directory:
<URL: http://www.addbalance.com/word/index.htm>
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://www.addbalance.com/usersguide/index.htm>
See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
.
"Steve Hudson" <st...@wright.com.au> wrote in message
news:h18b0usfi5i7416ds...@4ax.com...
What is it that I am doing when I run the following code? Are the defined
list templates not deleted but merely unreferenced? The code was developed
in trying to write a macro to set up a set of styles and an outline list
template. I started by recording Dave Rado's instructions for manually
attaching a custom template to a set of styles and one of the things that he
said to do was to reset each of the templates that shows on the screen of
six. I am using the Count property to get the ones past the six displayed as
well.
Private Sub ResetListMacro()
'
' ResetListMacro Macro
' Macro written 11/19/01 by Charles Kyle Kenyon
' Resets Outline List Templates in document to base
'
' Declare Variables
Dim iCount As Integer
Dim iNumber As Integer ' Number of ListTemplates
'
' Get number of (outline) ListTemplates
iNumber = ListGalleries(wdOutlineNumberGallery).ListTemplates.Count
'
' Reset all ListTemplates to system clear
For iCount = 1 To iNumber
ListGalleries(wdOutlineNumberGallery).Reset iCount
Next iCount
'
' Clear Variables declared in this procedure - may not be necessary
iCount = Empty
iNumber = Empty
End Sub
What is the difference between resetting a list template and deleting it?
--
Charles Kenyon
Word New User FAQ & Web Directory:
<URL: http://www.addbalance.com/word/index.htm>
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://www.addbalance.com/usersguide/index.htm>
See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
"Steve Hudson" <st...@wright.com.au> wrote in message
news:h18b0usfi5i7416ds...@4ax.com...
The goal is to develop an analyser that will strip the garbage out of
documents, and set up proper definitions for the lists that remain.
It appears that I am only one of many innocents who tread this path warily,
not knowing where, when or how the next obstacle will appear.
:o)
"Charles Kenyon" <keny...@remove.no.spam.addbalance.com> wrote in message
news:ubiIJ6JeBHA.2196@tkmsftngp04...
Andrew
--
Andrew Gabb
email: ag...@tpgi.com.au Adelaide, South Australia
phone: +61 8 8342-1021, fax: +61 8 8269-3280
-----
I want to be able to eliminate a specific ListTemplate, not just clear down
the lot.
The help describes ListTemplates as being decendent from "Multiple Objects",
surely this can't mean that
they are capable of having more than one parent object !
I thought I might be able to trace a template to a gallery using the .parent
property, but I have been unable to use the .parent property to discover
what the parent object is. I'll keep you posted if I crack it.
"Charles Kenyon" <keny...@remove.no.spam.addbalance.com> wrote in message
news:ubiIJ6JeBHA.2196@tkmsftngp04...
> You can Add your own template using VB, or let Word add one for you whenever
> you modify a list.
> So how do they get cleaned out when they are no longer used.
>
MS hasn't provided this functionality in the VBA interface. But the patch referred to in Andrew's message
is now part of Word 2002 (and one of the 2000 patches - SR2 I think - as well). This means that, when the
number of ListTemplates in a doc reaches a certain limit, unused ones will be deleted.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum
This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not
by e-mail :-)
Ian
"Cindy Meister -WordMVP-" <CindyM...@swissonline.ch> wrote in message
news:VA.000050c7.00afc321@speedy...
> This sounds more like a "quick fix" workaround to stop it crashing rather
> than providing a better control mechanism, or the tools to manage it.
>
No argument, there. I'm just supplementing the info in this thread :-)
About all you can really do is send an email to msw...@microsoft.com,
requesting the functionality. Be very specific about what you want, why
it's necessary, and the business impact (generally, not just for you).
Anyways, the main reason for your confusion, I think, is there are TWO
sets of listtemplates. (I will try and keep this light and fluffy)
One set is in the Galleries (Bullet and Numbering dialog). You are
mucking with these in your code below. These are "system" settings,
stored in the registry. My GUESS is the registry entry points to the
style offset, thus changing your style lists will corrupt lists that
aren't based on default styles.
Now, when you actually APPLY a list style to the document, Word very
badly attempts to do this:
1) Determine whether this style's listtemplate has an instance in the
document already. For built-in list styles the listtemplate gets the
same "name" (virtual, not actually available to the VBA user) as the
style so they are a bit safer to use.
2) If it has, link to that. If it hasn't, copy the gallery entry to
the document and link to it.
My gut feeling is that the manual list restart adds a new
characteristic to the list, so adding a new list of same style after
restarting an old one will just about always add a redundant list -
but I havent tested this fully yet.
So, your code takes all the liddle entries in the Bullets and
Numbering dialog and returns them to original, installed settings - a
very wise piece of advice to follow before setting your own tweaks in
place for a number of reasons. It doesn't do boo to any listtemplates
that have been stamped down into the document.
These are the troublesome listtemplates that eventually cause your
document to go belly-up. They cannot be deleted, and resetting them
just screws your document up. They are "attached" to various paramarks
throughout the document. As the listtemplates collection belongs to
either the Galleries or the Activedocument, there is no way to tell
its binary offset and thus its rough location in the doc.
However, if you do find the para it is attached to, copy the para
MINUS the para mark to the new doc, and problem solved. I will be
wrapping a lot of this technology up shortly in a Rebuild! template.
Steve H (sorry for the length, its a bitchin complex subject)
Steve Hudson , HDK List MVP
Principal Technical Writer
Steve
Steve Hudson , HDK List MVP
Word New User FAQ & Web Directory:
<URL: http://www.addbalance.com/word/index.htm>
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://www.addbalance.com/usersguide/index.htm>
See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
"Steve Hudson" <st...@wright.com.au> wrote in message
news:jb7j1u4qej4altmh3...@4ax.com...
> This is kinda amusing - the easiest way to clear out excess
> listtemplates is to keep adding them until the count magically drops
> ??? :-)
>
Yeah, I know. That was my reaction, too :-) <hold-head-and-groan>
-- Cindy