Results 1 to 12 of 12
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Copying bullet styles from template (Word97 (NT))

    Hi

    Apologies in advance if this has been said before, but it's certainly new to me.

    When using Word's Organizer to copy files from the template to the active document, the process often screws up styles involving bullets or numbers. What I've discovered is that this doesn't happen if the cursor is in a paragraph using the style being copied.

    So, to update all styles, I've written a macro that:
    <UL><LI>Goes to the end of the document (just a convenient spot to work).
    <LI>Changes the style of that paragraph to the style being copied.
    <LI>Copies the style.
    <LI>Repeats for all styles in the template (change style, copy, change style, copy, ...).
    <LI>Resets the paragraph style to what it was at the start.[/list]Seems to work like a gem.

    Note: For some reason, the method doesn't seem to work if the cursor's at the start of the document.

    Dale

  2. #2
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,048
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Copying bullet styles from template (Word97 (NT))

    Hi Chris,

    A couple of thoughts...

    What happens with the Organizer if you copy the styles three times? (I.e. copy them all, then again, then again)
    I've found this procedure preserves links between styles.

    Bullets are tied to Word's numbering list templates (which are not really templates). The only way to reliably copy these is if they are properly linked to styles. See the Word numbering articles listed in the <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=wrd&Number=111549> FAQ</A>.
    Charles Kyle Kenyon
    Madison, Wisconsin

  3. #3
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Copying bullet styles from template (Word97 (NT))

    Dale,

    Just to add to Charles' thoughts:
    The method you're using is, in my experience, a sound one.

    You'll see a lot of discussion on some of the links Charles has provided to the MS newsgroups, of setting up numbering lists programatically. The great difficulty there (if memory serves) revolves around reliably naming numbering list templates so you can invoke them later as needed.

    What I've done, and which seems much simpler, is similar to your method - I create the numbering/styles setup manually, but I do use a macro to fix 'broken numbering'. Also I have a macro to translate words in autonumbering into many different languages i.e. "Article" + "Section" (for a multlanguage template).

    The key to both of these macros is to ensure that the insertion point is in an example of a paragraph which has the "Level 1" numbering style applied to it - this always ensures that the numbering settings in the macro are getting applied to the correct list template - as you observe, this always works really well.

    Gary

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Copying bullet styles from template (Word97 (NT))

    Hi Chas

    I should have said.

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Copying bullet styles from template (Word97 (NT))

    Thanks, Gary

    1. Can I see your macro to fix 'broken numbering'? (Is it posted on this site?)

    2. I don't understand the relevance of level 1, and why that would help.

    My apologies, again, if this has all been covered before.* But there's been so much discussion, it's a bit hard for a latecomer to get to the key points.

    Dale

  6. #6
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,048
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Copying bullet styles from template (Word97 (NT))

    Hi Dale,

    When I talk about copying three times, I'm talking about doing it using the Organizer, not copy and paste. When you use the Organizer, the curosor position shouldn't matter at all since what is being copied is only the styles, not any text.
    Charles Kyle Kenyon
    Madison, Wisconsin

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Copying bullet styles from template (Word97 (NT))

    Hi Chas

    I also am talking about using the Organizer, but my experience doesn't fit with yours, Chas.

    What I've found is that having the cursor in an example of the style is critical.

  8. #8
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Copying bullet styles from template (Word97 (NT))

    Hi again,

    Addressing the second one first:

    Relevance of level 1 - it's a reliable rule, when manually editing or repairing an outline number list, to have your insertion point in a paragraph that is an example of the "Level 1" style for that outline list, before going to the numbering customize dialog - this ensures that you are working on the correct list template and everything always stays linked properly.
    My observation when trying to do this with a macro was "If that method proves reliable when doing numbering manually, why not have the macro do that too?" i.e. start at a "Level 1" paragraph - it has proved to be very reliable.

    Fix broken numbering macro - I haven't posted one because the details of it would be specific to the formatting of a specific outline numbering list, and therefore not applicable to someone else's. But here's a really easy way to make such a macro yourself:

    First build your outline numbering list, and link it to the appropriate styles.
    When you are sure that it is working perfectly, make sure your insertion point is in a paragraph that is an example of the "Level 1" style for that outline numbering list.
    Then record a macro of your doing the following steps:
    Format > Bullets & Numbering > Customize > OK.
    Stop the macro recorder.

    Now go look at the code that was recorded - what you'll see is a very lengthy chunk of code - what that code is, is a recording of every setting of every level of your outline numbering list, in its correct and pristine condition.

    To use it to correct broken numbering in the future, just ensure your insertion point is in a "Level 1 numbering style" paragraph, and then run the macro.

    You can also add methods to the macro to automatically find an example of the required style and putting the selection there, or if not found, going to the end of the document and temporarily inserting a paragraph with that style, before the update numbering code runs.

    Hope the above makes sense,
    Gary

  9. #9
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Copying bullet styles from template (Word97 (NT))

    Sure does (make sense), Gary.

    Thanks for your help
    Dale

  10. #10
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copying bullet styles from template (Word97 (NT))

    Hi Gary,

    <img src=/S/ribbon.gif border=0 alt=ribbon width=15 height=15>Great idea! I'll add such a macro to my templates -- this will certainly save much work and headaches later on!
    I had already planned to build/repair my heading and list styles with VBA, but hadn't realized how easy it is to fix the list template!

    Before running your macro to re-define the list template and re-link the styles, it might help to re-set each style in the list template with some code like
    <pre> With ActiveDocument.Styles("List Number")
    .LinkToListTemplate ListTemplate:=Nothing
    .ParagraphFormat.LeftIndent = 0
    .ParagraphFormat.FirstLineIndent = 0
    .ParagraphFormat.TabStops.ClearAll
    End With
    With ActiveDocument.Styles("List Number 2")
    ...</pre>


    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Thank you for the neat tip, Klaus

  11. #11
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Copying bullet styles from template (Word97 (NT))

    You're welcome, Klaus!

    Your suggestion sounds sensible; in my limited slice of experience with this, it hasn't proved necessary (will keep it in mind though)

    Another couple of benefits to the approach described, not fleshed out in my previous note:

    This gets around the whole very complex issue of assigning names to list templates - again, if I'm understanding Dave R. et al's discussions, the conclusion was that it's necessary to assign a name to a list template, in order to reliably be able to reapply it in various settings in the future - and the only way to assign a name to a list template is to build the whole list programmatically in the first place - a very complicated business judging by the threads I read.
    For those of us who prefer to build our outline lists manually to begin with, this method provides a way to reliably address that outline list in the future, without having had to resort to the complexity of a code-created named list template.

    Similarly, another issue that's often flagged as a source of difficulty is the non-standardization of gallery positions in different user's environments - so if you are relying solely on gallery position to assign a list template, you can get unpredictable results from user to user.
    Again, this method gets around that limitation - it simply doesn't matter what the user's gallery view looks like.*

    * With the following caveat: have never tested this but possibly it could cause trouble:
    Suppose I've used Gallery Position #3 to build my new outline list, record a macro of it etc. - the code will contain a hard reference to Gallery Position #3 and that's where the list will appear if you run the code.
    Conceivably if you had elsewhere in the same document, an unrelated outline list, which had originally also been created using Gallery Position #3, then running the macro might adversely affect this other outline list - I'm not sure, it may not, but have never tested it.
    At least this would point as a precaution to using a different Gallery Position for building each different outline numbering list you may use in a given template or document - I've never seen a template or document that needed more than 7 different outline numbering lists so that shouldn't be too much of a constraint.

    Gary

  12. #12
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copying bullet styles from template (Word97 (NT))

    Hi Gary,

    I don't know if my addition would make sense for every user's outline numbered lists: I always remove indents and tabs from all list styles before I define the numbering.
    In my experience, this removes a lot of problems: Since indents are stored in the styles (= in *.DOT) and in the list template (= in the file), things tend to get messy otherwise.

    You can easily assign a name without VBA: it's the box at the bottom left of the numbering dialog; just type in any name.

    It's supposed to make the numbering more stable; I haven't found much real evidence for that claim, but my experience is very limited.

    Regarding the Gallery, I think it just shows a more or less random choice of the (perhaps hundreds of) list templates in the document.
    Since your recorded code sets one of them and then immediately links the top list style to that list template, I don't think it matters which Gallery position is chosen ... but again, I may well be wrong.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Klaus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •