-
WSstephan
AskWoody LoungerYou’re using the wrong control here to get the job done. Use the listbox and set it to 3 columns instead of the textbox. I think this should make your life a little easier.
Stephan
-
WSstephan
AskWoody LoungerAndrew,
Yes, I agree that Word doesn’t have Activate and Deactivate events like Excel is bad.
Basically, your only other alternatives would be:
(1) to put the code to turn the AutoFormatAsYouType options off in the AutoNew and AutoOpen event procedures, and also write code to turn the options back on in the AutoClose procedure. The problem with this approach, however, is if the user works with more than one document at a time, these 3 Word event procedures are useless.
or
(2) simply have a button on a toolbar which will enable the user to toggle the settings (without having to go into Tools | AutoCorrect | etc.)
Sub ToggleAutoFormat()
With Options
If .AutoFormatAsYouTypeApplyBulletedLists = True Then
.AutoFormatAsYouTypeApplyBulletedLists = False
.AutoFormatApplyBulletedLists = False
.AutoFormatAsYouTypeApplyNumberedLists = False
Else
.AutoFormatAsYouTypeApplyBulletedLists = True
.AutoFormatApplyBulletedLists = True
.AutoFormatAsYouTypeApplyNumberedLists = True
End If
End With
End SubHope that helps.
Best regards,
Stephan
-
WSstephan
AskWoody LoungerTry this snippet of code. This should do the trick for you:
Dim aTable As Table
Dim aCell As Cell
Dim CellRange As RangeFor Each aTable In ActiveDocument.Tables
For Each aCell In aTable.Range.Cells
Set CellRange = aCell.Range
CellRange.MoveEnd Unit:=wdCharacter, Count:=-1
‘Check to see if cell is empty, if so insert a “0”
If CellRange.Text = “” Then
CellRange.InsertAfter Text:=”0″
End If
Next aCell
Next aTableBest regards,
Stephan
-
WSstephan
AskWoody LoungerI propose you simply put the following code somewhere in the AutoExec procedure of your global template:
With Options
.AutoFormatAsYouTypeApplyBulletedLists = False
.AutoFormatApplyBulletedLists = True
.AutoFormatAsYouTypeApplyNumberedLists = False
End WithBest regards,
Stephan
-
WSstephan
AskWoody LoungerI would like to thank everyone for their replies here. Your input has been very helpful.
Stephan
-
WSstephan
AskWoody LoungerBAM and kelliel,
Wow, thanks for setting me straight on this. I had no idea. From now on, I’ll have to remember not to recommend Microsoft Word features that I’ve only used successfully in other products (like WordPerfect). Sorry about that.
Stephan
-
WSstephan
AskWoody LoungerThe answer to this sort of thing is to use the master document and subdocuments features in Word.
Once upon a time, I used the master document and subdocuments features (not in Word, but in WordPerfect for Windows — but the functionality is essentially the same for both) with great success to put together a number of reference books in a publishing company I was working at. Essentially, each chapter in the books would be a separate file. The entire books were the master documents, and within it contained subdocuments — nothing more than references to the files comprising the separate chapters.
This solves your problem of having someone edit/update individual files and also having the entire book/manual update at the same time.
And yes, having a Master document/subdocuments setup is definitely conducive to setting up an index — you just have to remember to update the index whenever individual files are changed.
Stephan
-
WSstephan
AskWoody LoungerPhil,
Thanks, that’s exactly what I needed to do. Wow, it’s shocking how much Word functionality I don’t know (after years of working with it and programming in it).
Thanks again.
Stephan
-
WSstephan
AskWoody LoungerTo Andrew and all:
Ah, I see what you mean now. That “quick” list of AutoText entries is based on the style of the selection. I didn’t know that.
A few of my users had insisted that I set up a permanent “quick” list of the most common firm-wide AutoText entries, but now I realize that “quick” list doesn’t work like that.
Thanks again for enlightening me.
Stephan
-
WSstephan
AskWoody LoungerGary and BAM,
Thanks for your replies, guys. To make it absolutely clear, what I’m talking about, I’m attaching a file w a screen shot.
See the list of AutoText entries that appear beneath the “AutoText” and “New” commands? I want to manipulate that.
Thanks again.
Stephan
-
WSstephan
AskWoody LoungerIf you want the directory itself, you could just add a line of code just below the .Display line:
strDirName = CurDir()
However, for whatever reason, you don’t need the directory name here to open up the user’s selected file. After your chunk of code, if you add the following:
‘if user doesn’t dismiss dialog
If .Display -1 Then
Documents.Open strFileName
End IfThis will open up the file chosen by the user. No path is needed in this case. Go figure.
-
WSstephan
AskWoody LoungerGood, happy to hear it.
By the way, do you have a copy of “Learning Word Programming” by Steven Roman (Publisher: O’Reilly)? If you don’t, get it. A lot of the code I gave you here was taken directly from that book.
-
WSstephan
AskWoody LoungerTry this:
‘******************************************************
Sub ManipulateAllHeadersFooters()
Dim aSect As SectionFor Each aSect In ActiveDocument.Sections
‘Do your thing to the primary header
With aSect.Headers(wdHeaderFooterPrimary)
‘Perform x…
NormalTemplate.AutoTextEntries(“DRAFT”).Insert Where:=.Range
End With‘Repeat for primary footer
With aSect.Footers(wdHeaderFooterPrimary)
‘Perform x…
NormalTemplate.AutoTextEntries(“DRAFT”).Insert Where:=.Range
End With‘If first page header/footer exists, then repeat for those too
If aSect.Headers(wdHeaderFooterFirstPage).Exists ThenWith aSect.Headers(wdHeaderFooterFirstPage)
‘Perform x…
NormalTemplate.AutoTextEntries(“DRAFT”).Insert Where:=.Range
End WithWith aSect.Footers(wdHeaderFooterFirstPage)
‘Perform x…
NormalTemplate.AutoTextEntries(“DRAFT”).Insert Where:=.Range
End WithEnd If
‘Finally, if even page header/footer exists, then repeat for those as well
If aSect.Headers(wdHeaderFooterEvenPages).Exists ThenWith aSect.Headers(wdHeaderFooterEvenPages)
‘Perform x…
NormalTemplate.AutoTextEntries(“DRAFT”).Insert Where:=.Range
End WithWith aSect.Footers(wdHeaderFooterEvenPages)
‘Perform x…
NormalTemplate.AutoTextEntries(“DRAFT”).Insert Where:=.Range
End WithEnd If
Next aSectEnd Sub
‘******************************************************See what I mean about not having to open each header/footer? Notice all I do in each case is set the range of header/footer (instead of the range of the selection) to be the autotext entry.
BTW, I gave you some slightly buggy code before, so get rid of the whole thing and use the above.
-
WSstephan
AskWoody LoungerThat shouldn’t be happening.
Why don’t you post a small sample of your code.
-
WSstephan
AskWoody LoungerUse this as your skeletal code:
‘****************************************************
Sub ManipulateAllHeadersFooters()
Dim aSect As SectionFor Each aSect In ActiveDocument.Sections
‘Do your thing to the primary header
With aSect.Headers(wdHeaderFooterPrimary)
‘Perform x…
End With‘Repeat for primary footer
With aSect.Footers(wdHeaderFooterPrimary)
‘Perform x…
End With‘If first page header/footer exists, then repeat for those too
If aSect.Headers(wdHeaderFooterFirstPage).Exists ThenWith aSect.Headers(wdHeaderFooterPrimary)
‘Perform x…
End WithWith aSect.Footers(wdHeaderFooterPrimary)
‘Perform x…
End WithEnd If
‘Finally, if even page header/footer exists, then repeat for those as well
If aSect.Headers(wdHeaderFooterEvenPages).Exists ThenWith aSect.Headers(wdHeaderFooterEvenPages)
‘Perform x…
End WithWith aSect.Footers(wdHeaderFooterEvenPages)
‘Perform x…
End WithEnd If
Next aSectEnd Sub
‘****************************************************BTW, in this example, you should not think in terms of the code “opening” each header/footer. Instead, think in terms of it simply “acting” on each header/footer object.
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Is it Local or is it Microsoft Account?
by
RetiredGeek
21 minutes ago -
Does Your State Reveal Who’s Been Hacked?
by
Nibbled To Death By Ducks
14 hours, 33 minutes ago -
A one-year extension to Windows 10 — almost free!
by
Susan Bradley
42 minutes ago -
Windows Configuration Update (KB5062324) – June 2025
by
Alex5723
1 hour, 56 minutes ago -
A federal judge sides with Anthropic in lawsuit over training AI
by
Alex5723
19 hours, 26 minutes ago -
Name of MS Word Formatting Feature
by
John Baum
8 hours, 13 minutes ago -
InControl Failure?
by
Casey H
6 hours, 36 minutes ago -
Microsoft : Free 1 year support for Windows 10 after EOL
by
Alex5723
8 hours, 18 minutes ago -
MS-DEFCON 3: Businesses must tread carefully
by
Susan Bradley
1 minute ago -
McLaren Health Care says data breach impacts 743,000 patients
by
Nibbled To Death By Ducks
1 day, 18 hours ago -
WhatsApp banned on House staffers’ devices
by
Alex5723
1 day, 13 hours ago -
Is your device eligible?
by
Susan Bradley
1 day, 21 hours ago -
Windows 11 Insider Preview build 26200.5661 released to DEV
by
joep517
2 days, 3 hours ago -
Windows 11 Insider Preview build 26120.4452 (24H2) released to BETA
by
joep517
2 days, 3 hours ago -
Hello Windows…My Problem is Windows Hello…
by
rdleib
2 days, 4 hours ago -
New Canon Printer Wants Data Sent
by
Win7and10
2 days, 5 hours ago -
I set up passkeys for my Microsoft account
by
Lance Whitney
3 hours, 22 minutes ago -
AI is for everyone
by
Peter Deegan
2 days, 4 hours ago -
Terabyte update 2025
by
Will Fastie
1 day, 22 hours ago -
Migrating from Windows 10 to Windows 11
by
Susan Bradley
6 hours, 3 minutes ago -
Lost sound after the upgrade to 24H2?
by
Susan Bradley
23 hours, 5 minutes ago -
How to move 10GB of data in C:\ProgramData\Package Cache ?
by
Alex5723
1 day, 7 hours ago -
Plugged in 24-7
by
CWBillow
2 days, 13 hours ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
3 days, 17 hours ago -
Have Copilot there but not taking over the screen in Word
by
CWBillow
3 days, 14 hours ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
5 days, 8 hours ago -
Are Macs immune?
by
Susan Bradley
2 hours, 21 minutes ago -
HP Envy and the Function keys
by
CWBillow
4 days, 15 hours ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
2 days, 9 hours ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
5 days, 19 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.