I have a template where I've created a custom list style, and ensured that that list style is used when the user clicks on the "bullet" icon on the ribbon (by overriding FormatBulletDefault
).
However, if the user types:
* foo
...then Word will automatically turn that into a bulleted list using the "wrong" (default) list style, which is not the one I want to use. This will mean that users end up with wrongly-formatted lists.
If I could turn off the "automatically create bulleted lists" setting for my template, then I might consider that, but it's an application setting, and I don't want to turn it off for all documents.
Is there any way to intercept the auto-creation of a bulleted list? Or to change the list style it uses?
I do not know of any way to intercept this behavior as it is being caused by Word's AutoCorrect AutoFormat As You Type functionality. However you can turn off the Apply as you type|Automatic bulleted lists behavior temporarily. To do so, add the following code to Private Sub Document_Open():
ActiveDocument.Application.Options.AutoFormatAsYouTypeApplyBulletedLists = False
This will turn off this functionality for Word globally (and as such will affect concurrently opened documents), but if you include the reverse in Private Sub Document_Close():
ActiveDocument.Application.Options.AutoFormatAsYouTypeApplyBulletedLists = True
the setting will be restored. You can find the Word object model mappings for the AutoFormat As You Type functionality here:
http://technet.microsoft.com/en-us/library/Ee692775.big_asyoutype(en-us,TechNet.10).jpg
and an article explaining the VBA implementation of these settings here: