Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-16-2024, 08:04 AM
John9210 John9210 is offline Macro not working Windows 7 64bit Macro not working Office 2007
Advanced Beginner
Macro not working
 
Join Date: Feb 2015
Posts: 38
John9210 is on a distinguished road
Default Macro not working


Code:
Sub MyBullet()
'
' MyBullet Macro
'
'
   ' The variable "char" will contain
   ' the number of characters moved.
   Dim char As Long
   char = Selection.StartOf(Unit:=wdParagraph, Extend:=wdMove)
    Selection.TypeText Text:=vbTab & "•" & vbTab
    Selection.Style = ActiveDocument.Styles("MyBullet")

End Sub

Last edited by macropod; 09-16-2024 at 07:56 PM. Reason: Added code tags
Reply With Quote
  #2  
Old 09-16-2024, 10:48 AM
Charles Kenyon Charles Kenyon is offline Macro not working Windows 11 Macro not working Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,536
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

What is it you want to do?
Why are you using a macro to do it?
Reply With Quote
  #3  
Old 12-13-2024, 11:32 AM
John9210 John9210 is offline Macro not working Windows 7 64bit Macro not working Office 2007
Advanced Beginner
Macro not working
 
Join Date: Feb 2015
Posts: 38
John9210 is on a distinguished road
Default

The macro inserts a special bullet into the document. Why a macro? Ans: quick access to create bullets as I type.
Reply With Quote
  #4  
Old 12-13-2024, 01:08 PM
Italophile Italophile is offline Macro not working Windows 11 Macro not working Office 2021
Expert
 
Join Date: Mar 2022
Posts: 554
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

You’re attempting to use a sledgehammer to crack a nut.

Just create, or modify, a bulleted style in your document. Assign a keyboard shortcut to that style. Result, quicker access to correctly create bullets as you type.
Reply With Quote
  #5  
Old 12-15-2024, 11:21 AM
Charles Kenyon Charles Kenyon is offline Macro not working Windows 11 Macro not working Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,536
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Italaphile is correct.
Another method would be to save as a building block (also with a keyboard shortcut) or an AutoCorrect entry.

Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perfect macro not working when its code is inserted in larger macro RobiNew Word VBA 3 10-18-2023 03:19 AM
Macro not working harry Outlook 3 12-12-2022 12:22 AM
Need Help with this Macro-Partially Working rsrasc Excel Programming 10 09-10-2020 02:38 PM
Just one macro not working Ulodesk Word VBA 1 04-01-2019 09:16 AM
Macro not working Fraction macro not working Ulodesk Word VBA 1 07-18-2012 04:01 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:34 AM.


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