Microsoft Office Forums

Microsoft Office Forums (https://www.msofficeforums.com/)
-   Word (https://www.msofficeforums.com/word/)
-   -   Adjust list indents for all bulleted text (of different bullets) (https://www.msofficeforums.com/word/9059-adjust-list-indents-all-bulleted-text-different.html)

ghumdinger 09-18-2011 07:07 AM

Adjust list indents for all bulleted text (of different bullets)
 
Dear all,

I'm working on a doc where I have to adjust all bulleted text (only bulleted text) to 0.25" bullet position and 0.25" text indent.

I have tried to come up with a macro to do this, but it changes the different bullet symbols to the same bullet symbol. I only want the indents to be edited, not the bullet symbols. I am not a coder, so the macro was created using the record function.

I would appreciate if someone could tell me what needs to be changed. Thanks!

Jay

Code:

    Selection.WholeStory
    With ListGalleries(wdBulletGallery).ListTemplates(1).ListLevels(1)
        .NumberFormat = ChrW(61607)
        .TrailingCharacter = wdTrailingTab
        .NumberStyle = wdListNumberStyleBullet
        .NumberPosition = InchesToPoints(0.25)
        .Alignment = wdListLevelAlignLeft
        .TextPosition = InchesToPoints(0.25)
        .TabPosition = wdUndefined
        .ResetOnHigher = 0
        .StartAt = 1
        With .Font
            .Bold = wdUndefined
            .Italic = wdUndefined
            .StrikeThrough = wdUndefined
            .Subscript = wdUndefined
            .Superscript = wdUndefined
            .Shadow = wdUndefined
            .Outline = wdUndefined
            .Emboss = wdUndefined
            .Engrave = wdUndefined
            .AllCaps = wdUndefined
            .Hidden = wdUndefined
            .Underline = wdUndefined
            .Color = wdUndefined
            .Size = wdUndefined
            .Animation = wdUndefined
            .DoubleStrikeThrough = wdUndefined
            .Name = "Wingdings"
        End With
        .LinkedStyle = ""
    End With
    ListGalleries(wdBulletGallery).ListTemplates(1).Name = ""
    Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
        ListGalleries(wdBulletGallery).ListTemplates(1), ContinuePreviousList:= _
        False, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _
        wdWord10ListBehavior
End Sub


Stefan Blom 09-18-2011 11:45 AM

Recorded VBA doesn't handle bullets (or numbering) very well. A lot of manual "tweaking" will be required.

Does the document contain only bullets, or are there numbered items as well (numbered items whose indentation should not change)? Are you using a single-level list or a multilevel (outline) list?

ghumdinger 09-18-2011 08:10 PM

Hi Stefan,

The document contains only bullets, and no numbering. There are multiple levels of bullets, but the author did not configure them using the multilevel list.

I am trying to adjust all the paragraphs with the bullets (whatever their level) to the same text and bullet indent, but such that the bullet symbol does not change.

Thanks,
Jay

Stefan Blom 09-19-2011 01:50 AM

OK, at least in principle, this shouldn't be difficult. Click the bullet character of the first item. That would highlight all bullets that are part of the same list (at that particular level). Then right-click again and select Adjust List Indents from the context menu. Specify the desired indentation. Repeat this for other bullets.

With a macro, you'd need something like this:

Code:


Sub ChangeListParasInDoc()
Dim LP As ListParagraphs
Dim p As Paragraph
Dim i As ListLevel
Set LP = ActiveDocument.ListParagraphs
For Each p In LP
For Each i In p.Range.ListFormat.ListTemplate.ListLevels
i.TrailingCharacter = wdTrailingTab
i.NumberPosition = 18 ' 0.25" indent from left margin
i.TextPosition = 36 ' position from left margin of text
i.TabPosition = 36 ' position of tab stop
Next i
Next p
End Sub


ghumdinger 09-19-2011 03:20 AM

The adjust list indent method worked. I wasn't aware that I could change the list indent for all paras of the same bullet at once.

The macro got a code 7 error. But never mind that, I'll read more about macros when I have time.

On a different note, is there a way to cause all paras marked with a certain bullet to be bold, for e.g., perhaps by selecting the bullet which selects all the bullets of that type and then formatting it with an unique mark (e.g. double strike through) and using find & replace to effect the formatting change that I want using prefix/ wildcards?

Stefan Blom 09-19-2011 04:45 AM

I just tested the macro again and I see that it isn't working with lists attached to styles. I don't know why--I have to think about this more. If I remember correctly, it did work in older versions...

I'm glad you got it to work in the user interface. It's the reliable way, apparently. :-)

And, yes, once you have selected bullets (or numbers) by clicking them you can apply font formatting to them. Note that the entire bullet/number, including any leading or trailing text, must use the same font formatting. Some formatting, such as strike-through, may not be visible, depending on the bullet character chosen.

I'm not sure how you want to use Find and Replace. You can't use it with text included with a bullet or number character, if that's what you're asking.

ghumdinger 09-19-2011 05:39 AM

I'm trying to change the formatting for the text that's bulleted with a particular bullet, in my case >. But since there's no distinctive style attached to them, I'm trying to find a workaround.

I just tried another: Double click on that bullet to select all bullets of that symbol, apply a new style of the formatting I want. But it doesn't work. The style is only applied to that particular para of the bullet which I clicked and not for all the paras in the doc bulleted with >. =(

Stefan Blom 09-19-2011 07:11 AM

You can of course apply a character style to the whole bullet/number (including any leading or trailing text) in a list. That way, you can easily change font settings later, by modifying the style.

ghumdinger 09-19-2011 07:20 AM

Thanks.

Does it work after the fact? I tried to change the font setting for the character style for that particular bullet symbol, but it does not automatically apply to all other paras with that symbol, unlike when I changed the indent.

Stefan Blom 09-19-2011 10:28 AM

I haven't tested this thoroughly, but it should work the way styles work in any other area of the document, that is, if you update the style, text using that style will update automatically.

In particular, note that I haven't tested if this is backward compatible (in case you want to save in Word 97-2003 format).

ghumdinger 09-19-2011 07:18 PM

Stefan, what I meant was to change the formatting after the document has already been largely done (it was by a previous author). For e.g.

- Test 1
> Test 2
- Test 3
> Test 4

I'm trying to bold all paragraphs with the ">" bullet. They have not been marked with a character style at the point of creation. I've tried to define a character style for all the ">" bullets at once (Define new bullet> Font> Bold), but the bold formatting only applies to, for e.g. only Test 2 instead of Test 2 & 4. On the other hand, changing the list indent does work for all the paragraphs with the same bullet symbol automatically.

It would be indeed so so much easier if I could find all ">" and mark them with a style.

Thanks,
Jay

Stefan Blom 09-20-2011 12:22 AM

OK, you want to apply the bold to the text of the paragraph following a particular bullet? If you have the "Keep track of formatting" option selected at File tab | Options | Advanced, and then select the option to display "Bullet and numbering formatting" in the Style Pane Options dialog box (in the Styles pane, click the Options link), you can right-click the entry for the bullet in the Styles pane and click to Select All Instances; then format the text as desired.

ghumdinger 09-20-2011 09:46 PM

Oh my, you're marvelous!

Now that's a huge step forward in my education on Styles, from just knowing paragraph styles (which was already in itself quite powerful).

Cheers,
Jay

Stefan Blom 09-21-2011 12:59 AM

I'm glad I could help.

Note that if you want to enable the Select All X Instances feature with any blank document, you'll have to select "New documents based on this template" in the Style Pane Options dialog box before clicking OK.

For what it's worth, select All X Instances can be used with true styles as well (that is, with entries in the Styles pane that don't represent formatting or a style + formatting), but usually that shouldn't be necessary, as you can modify the style directly.


All times are GMT -7. The time now is 09:37 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft