-
WSJanB
AskWoody LoungerJefferson,
Thanks for the URL to a interesting post.
JanB
-
WSJanB
AskWoody LoungerJefferson,
Thanks for the URL to a interesting post.
JanB
-
WSJanB
AskWoody LoungerHans,
If Porley likes the idea, I’ll do that. And thanks for spreadsheet URL !
JanB
-
WSJanB
AskWoody LoungerHans,
If Porley likes the idea, I’ll do that. And thanks for spreadsheet URL !
JanB
-
WSJanB
AskWoody LoungerHans, and Porley of course,
I found out something quite interesting. I’m experimenting with Office 2003 (Dutch version) a bit because we are considering upgrading from Office 97. In Word 97 VBA there is only 1 event on application level that you can use: DocumentChange. But in Word 2003 VBA there are a lot more. One of them is WindowSelectionChange and that gave me an idea.
I created a document with 2 sections, marked section 1 as protected and section 2 as unprotected and then protected the document for forms.
In a properly declared class module I put this code:Public WithEvents wdApp As Word.Application
Private Sub WindowSelectionChange(ByVal Sel As Selection)
If Sel.Information(wdActiveEndSectionNumber) = 1 Then
ActiveDocument.Protect NoReset:=True, Type:=wdAllowOnlyFormFields
Else
ActiveDocument.Unprotect
End If
End SubIf I click, or move the cursor with the arrow keys in the unprotected Section 2, then the whole document is unprotected. And clicking, or moving the cursor with the arrow keys into Section 1 protects the whole document again, disabling the possibility to enter tekst in that section…
I just found out, so I’m not sure of all the drawbacks and ramifications yet, but it sure has some perspective!I don’t know of these extra events are already present in Word 2000 VBA, but I heard from a co-worker that there are more than 1 in Word XP. Because I dont have that version here, I cannot tell if this particular event is present and my code is working in Word XP.
JanB
-
WSJanB
AskWoody LoungerHans, and Porley of course,
I found out something quite interesting. I’m experimenting with Office 2003 (Dutch version) a bit because we are considering upgrading from Office 97. In Word 97 VBA there is only 1 event on application level that you can use: DocumentChange. But in Word 2003 VBA there are a lot more. One of them is WindowSelectionChange and that gave me an idea.
I created a document with 2 sections, marked section 1 as protected and section 2 as unprotected and then protected the document for forms.
In a properly declared class module I put this code:Public WithEvents wdApp As Word.Application
Private Sub WindowSelectionChange(ByVal Sel As Selection)
If Sel.Information(wdActiveEndSectionNumber) = 1 Then
ActiveDocument.Protect NoReset:=True, Type:=wdAllowOnlyFormFields
Else
ActiveDocument.Unprotect
End If
End SubIf I click, or move the cursor with the arrow keys in the unprotected Section 2, then the whole document is unprotected. And clicking, or moving the cursor with the arrow keys into Section 1 protects the whole document again, disabling the possibility to enter tekst in that section…
I just found out, so I’m not sure of all the drawbacks and ramifications yet, but it sure has some perspective!I don’t know of these extra events are already present in Word 2000 VBA, but I heard from a co-worker that there are more than 1 in Word XP. Because I dont have that version here, I cannot tell if this particular event is present and my code is working in Word XP.
JanB
-
WSJanB
AskWoody LoungerI think you discovered the single most frustrating thing for Word developers IMHO. It should be a consolation that there are millions of other developers all over the world that suffer with you… NOT!
If you really need the forms functionality – as we do – then there is really no alternativ I know of than to “hijack” all the relevant internal Word functions by writing your own Sub’s performing exactly the same task and storing those Sub’s in a add-in placed in the Word Startup folder. But even then there are quit a few drawbacks!For your particular problem there may be a work-around. From what you write I understand that you know how to use the checkboxes from the Forms toolbar. You can accomplish almost the same functionality with the checkboxes from the Toolset toolbar (not quite sure about this name, had to translate it from my Dutch version…). The VBA Sub’s handling these checkboxes must reside in the ThisDocument module.
I have no personal experience with these checkboxes. But I have a few documents with a commandbutton to perform a certain task. And that works fine in a unprotected document. The only drawback in my case is that this commandbuttons (and other controls) are always printed – at least I haven’t discovered yet how to prevent that.. But if that is no problem for your situation then this could be something to experiment with.Good luck
JanB -
WSJanB
AskWoody LoungerI think you discovered the single most frustrating thing for Word developers IMHO. It should be a consolation that there are millions of other developers all over the world that suffer with you… NOT!
If you really need the forms functionality – as we do – then there is really no alternativ I know of than to “hijack” all the relevant internal Word functions by writing your own Sub’s performing exactly the same task and storing those Sub’s in a add-in placed in the Word Startup folder. But even then there are quit a few drawbacks!For your particular problem there may be a work-around. From what you write I understand that you know how to use the checkboxes from the Forms toolbar. You can accomplish almost the same functionality with the checkboxes from the Toolset toolbar (not quite sure about this name, had to translate it from my Dutch version…). The VBA Sub’s handling these checkboxes must reside in the ThisDocument module.
I have no personal experience with these checkboxes. But I have a few documents with a commandbutton to perform a certain task. And that works fine in a unprotected document. The only drawback in my case is that this commandbuttons (and other controls) are always printed – at least I haven’t discovered yet how to prevent that.. But if that is no problem for your situation then this could be something to experiment with.Good luck
JanB -
WSJanB
AskWoody LoungerHi Boyley,
Maybe you can use something along these lines:
1. Place the templates in separate subdirs for each department (Dept1; Dept2; etc.)
2. Write Sub DeptTemplates
3a. Place a button on the Toolbar that calls DeptTemplates (if you want to preserve the standard FileNew command)
or
3b. Rename Sub DeptTemplates to FileNew (if you want to “hijack” the standard FileNew command)Public Sub DeptTemplates
Dim strOld As String
Dim strDept As String
strDept = InputBox(“Department name?”)
strOld = Options.DefaultFilePath(wdWorkgroupTemplatesPath)
Options.DefaultFilePath(wdWorkgroupTemplatesPath) = “” & strDept
Dialogs(wdDialogFileNew).Show
Options.DefaultFilePath(wdWorkgroupTemplatesPath) = strOld
End SubOfcourse you can use a dialog panel with a drop-down list for the departments. Otherwise you have to put some code in this Sub to check wether the user input is in fact an existing department. If not you can put the Inputbox on the screen again, or revert to a default path.
The lines with strOld in them can be omitted, but I think it’s good practice to put things back to the state/value it had before my code changed it.Hope this helps
JanB -
WSJanB
AskWoody LoungerHi Boyley,
Maybe you can use something along these lines:
1. Place the templates in separate subdirs for each department (Dept1; Dept2; etc.)
2. Write Sub DeptTemplates
3a. Place a button on the Toolbar that calls DeptTemplates (if you want to preserve the standard FileNew command)
or
3b. Rename Sub DeptTemplates to FileNew (if you want to “hijack” the standard FileNew command)Public Sub DeptTemplates
Dim strOld As String
Dim strDept As String
strDept = InputBox(“Department name?”)
strOld = Options.DefaultFilePath(wdWorkgroupTemplatesPath)
Options.DefaultFilePath(wdWorkgroupTemplatesPath) = “” & strDept
Dialogs(wdDialogFileNew).Show
Options.DefaultFilePath(wdWorkgroupTemplatesPath) = strOld
End SubOfcourse you can use a dialog panel with a drop-down list for the departments. Otherwise you have to put some code in this Sub to check wether the user input is in fact an existing department. If not you can put the Inputbox on the screen again, or revert to a default path.
The lines with strOld in them can be omitted, but I think it’s good practice to put things back to the state/value it had before my code changed it.Hope this helps
JanB -
WSJanB
AskWoody LoungerAnd, according to Woody, Office 2003 Professional has a full implementation of XML and that alone should be worth the upgrade.
JanB
-
WSJanB
AskWoody LoungerAnd, according to Woody, Office 2003 Professional has a full implementation of XML and that alone should be worth the upgrade.
JanB
-
WSJanB
AskWoody LoungerI typed that on the fly and did not check if there are any items in the pick list for the FileNew dialog.
Sorry that this is no solution for your particular issue. But look at the bright side: you learned something.
And I did too…!JanB
-
WSJanB
AskWoody LoungerI typed that on the fly and did not check if there are any items in the pick list for the FileNew dialog.
Sorry that this is no solution for your particular issue. But look at the bright side: you learned something.
And I did too…!JanB
-
WSJanB
AskWoody LoungerIt is possible to set a specific tab as the default when opening a dialog:
Dialogs(wdDialogFileNew).DefaultTab = xxx
As soon as you type the “=” you get a pop-up list with all the possibilities. Unfortunately this list contains all tabs, not just the ones for the dialog you want (wdDialogFileNew in this case).
Hope this helps.
JanB
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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
-
OTF, which backs Tor, Let’s Encrypt and more, sues to save its funding
by
Nibbled To Death By Ducks
3 hours, 23 minutes ago -
El Canal Maritimo (Awaiting moderation)
by
lourdespinson24
4 hours, 19 minutes ago -
Select multiple emails and they all open up! (Awaiting moderation)
by
CeeJay
9 hours, 42 minutes ago -
How to remove an update preview (Awaiting moderation)
by
Gunny
11 hours, 33 minutes ago -
Updating Windows 10 to Windows 11: 23H2 or 24H2?
by
Still Anonymous
14 hours, 7 minutes ago -
How can I update “Explorer Patcher”
by
WSplanckster
16 hours ago -
Check out the home page for Signal
by
CAS
13 hours, 52 minutes ago -
Windows 11 and Trial version of MS Office
by
Tex265
12 hours, 55 minutes ago -
Windows 11 Insider Preview build 26120.3585 (24H2) released to BETA
by
joep517
20 hours, 23 minutes ago -
Windows 11 Insider Preview build 26200.5510 released to DEV
by
joep517
20 hours, 27 minutes ago -
Windows 11 Insider Preview Build 26100.3624 (24H2) released to Release Preview
by
joep517
20 hours, 30 minutes ago -
Limits on User Names
by
CWBillow
17 hours, 13 minutes ago -
MS-DEFCON 4: Mixed bag for March
by
Susan Bradley
11 hours, 16 minutes ago -
Non Apple Keyboards
by
pmcjr6142
2 hours, 13 minutes ago -
How to delete your 23andMe data – The Verge
by
AJNorth
15 hours, 10 minutes ago -
7 common myths about Windows 11 (Microsoft AD)
by
EyesOnWindows
12 hours, 46 minutes ago -
Error updating to Win11 0x8024a205
by
bmeacham
1 day, 14 hours ago -
default apps
by
chasfinn
1 day, 14 hours ago -
Will MS Works 4 work in MS Win 11?
by
MileHighFlyer
1 day, 22 hours ago -
Adding links to text in Word 2000
by
sgeneris
19 hours, 26 minutes ago -
FBI warnings are true—fake file converters do push malware
by
Nibbled To Death By Ducks
1 day, 15 hours ago -
Classic and Extended Control Panel — no need to say goodbye
by
Deanna McElveen
18 hours, 9 minutes ago -
Things you can do in 2025 that you couldn’t do in 2024
by
Max Stul Oppenheimer
2 days, 3 hours ago -
Revisiting Windows 11’s File Explorer
by
Will Fastie
1 day, 11 hours ago -
Planning ahead for migration
by
Susan Bradley
12 hours, 1 minute ago -
Yahoo mail getting ornery
by
Tom in Az
1 day, 14 hours ago -
Is Spectrum discontinuing email service?
by
Peobody
1 day, 18 hours ago -
Practice what you preach! A cautionary tale.
by
RetiredGeek
1 day, 14 hours ago -
Looking for Microsoft Defender Manuals/Tutorial
by
blueboy714
1 day, 18 hours ago -
Win 11 24H2 Home or Pro?
by
CWBillow
1 day, 15 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.