Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-16-2017, 12:21 AM
puff puff is offline Issue of 2 fixed bullet points indent setting work together (code included) Windows 7 64bit Issue of 2 fixed bullet points indent setting work together (code included) Office 2013
Advanced Beginner
Issue of 2 fixed bullet points indent setting work together (code included)
 
Join Date: Apr 2017
Posts: 60
puff is on a distinguished road
Question Issue of 2 fixed bullet points indent setting work together (code included)

Hi all. I assigned 2 bullet points with specific indent settings to 2 hotkeys. However, when I use them together, there is a minor issue.
What I want to get: (This can be achieved if I press the Enter twice to eliminate the black dot and then press the hotkey for the black square)


2017-12-16_150153.jpg
Ps: the specific indent info are included in their codes below.
If I just press the hotkey for the black square in a blank line with the black circle in the front, I will get:
2017-12-16_150208.jpg

I tried to incorporate the 2 pressings of Enter into the macro of the black square, but it seems like under the recording mode, 2 pressings in a line starting with the black circle will simply create 2 blank lines rather than eliminate the black circle in the front. Could someone help me out on this? Thank you very much!

Code for the black circle:
Code:
Sub BlackCircle()
'the hot key is F13
    With ListGalleries(wdBulletGallery).ListTemplates(1).ListLevels(1)
        .NumberFormat = ChrW(61623)
        .TrailingCharacter = wdTrailingTab
        .NumberStyle = wdListNumberStyleBullet
        .NumberPosition = InchesToPoints(0.5)
        .Alignment = wdListLevelAlignLeft
        .TextPosition = InchesToPoints(0.75)
        .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 = "Symbol"
        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
Code for the black square
Code:
Sub BlackSquare()
'the hot key is F14
    With ListGalleries(wdBulletGallery).ListTemplates(1).ListLevels(1)
        .NumberFormat = ChrW(61607)
        .TrailingCharacter = wdTrailingTab
        .NumberStyle = wdListNumberStyleBullet
        .NumberPosition = InchesToPoints(0.75)
        .Alignment = wdListLevelAlignLeft
        .TextPosition = InchesToPoints(0.1)
        .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
Feel free to delete any unnecessary part of the code since they're from the recording.

Last edited by puff; 12-16-2017 at 04:14 PM.
Reply With Quote
  #2  
Old 12-16-2017, 12:33 PM
macropod's Avatar
macropod macropod is offline Issue of 2 fixed bullet points indent setting work together (code included) Windows 7 64bit Issue of 2 fixed bullet points indent setting work together (code included) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You should create an appropriately-formatted Style and use that instead of either the default or a macro.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 12-16-2017, 03:19 PM
puff puff is offline Issue of 2 fixed bullet points indent setting work together (code included) Windows 7 64bit Issue of 2 fixed bullet points indent setting work together (code included) Office 2013
Advanced Beginner
Issue of 2 fixed bullet points indent setting work together (code included)
 
Join Date: Apr 2017
Posts: 60
puff is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
You should create an appropriately-formatted Style and use that instead of either the default or a macro.
Sorry for the confusion. I think my major issue is to assign a bullet point to a key. I know the function of FormatBulletDefault but that only allows you to assign the default bullet point. Do you know how to assign other non-default bullets to a hotkey?

JK. I solved the assigning issue. My question now is in my edited post above.
Reply With Quote
  #4  
Old 12-17-2017, 01:33 PM
macropod's Avatar
macropod macropod is offline Issue of 2 fixed bullet points indent setting work together (code included) Windows 7 64bit Issue of 2 fixed bullet points indent setting work together (code included) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You are going about this completely the wrong way. I suggest you read:
https://support.office.com/en-us/art...7-1eb120dec563
http://www.addbalance.com/usersguide/styles.htm
https://shaunakelly.com/word/styles/stylesms.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 12-17-2017, 05:17 PM
puff puff is offline Issue of 2 fixed bullet points indent setting work together (code included) Windows 7 64bit Issue of 2 fixed bullet points indent setting work together (code included) Office 2013
Advanced Beginner
Issue of 2 fixed bullet points indent setting work together (code included)
 
Join Date: Apr 2017
Posts: 60
puff is on a distinguished road
Default

Thank you for your helpful links. I notice that a list bullet style will apply to all the bullet points in a document. However, I just use bullet points to organize notes, so their indents, although fixed within a section, might be flexible in a document's different sections. And that's why I used macro to give me a bullet with a default indent and allows some fluctuations. I still need to solve the problem mentioned previously though.
Reply With Quote
  #6  
Old 12-17-2017, 05:52 PM
macropod's Avatar
macropod macropod is offline Issue of 2 fixed bullet points indent setting work together (code included) Windows 7 64bit Issue of 2 fixed bullet points indent setting work together (code included) Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Forget the built-in list bullet Style; you can create multiple custom Bullet Styles & Indent Styles for a document. It's then just a matter of choosing which one you want to use in a given situation. See attached. You should not be using a macro to apply the formatting - that way lies document corruption.
Attached Files
File Type: docx Styles.docx (26.6 KB, 6 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help With Bullet Points In Powerpoint Phil_CF PowerPoint 2 09-10-2016 03:12 AM
Issue of 2 fixed bullet points indent setting work together (code included) Trouble using bullet points / sub bullet points within Word 2013 Mr Davo Word 2 04-18-2016 04:31 PM
Bullet text indent problem dfp1964 PowerPoint 0 12-04-2011 08:03 AM
Issue of 2 fixed bullet points indent setting work together (code included) Bullet points are messed up TempleClause Word 4 06-08-2010 11:53 AM
Indent Points in Word 07 crackinthekraken Word 0 01-19-2010 03:54 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:10 AM.


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