-
WSbjoeng
AskWoody LoungerHi again Gary!
Thanks a lot. I will look into the matter and do necessary amendments.
Here time is 11:50 and we still have some hours to go. But for you …. … sleep well and be fully rested tomorrow!!Best regards
Bj -
WSbjoeng
AskWoody LoungerThanks a lot Gary. Then I will not try the WindowBeforeDoubleClick Event. As you say; how do one know where the cursor is?
I also discovered that the code from Bill Coan at http://www.mvps.org/word/FAQs/Customizatio…d2000Header.htm actually has changed. The procedure Document_Close has been omitted. May be I understand why, but not completely. Using it caused the wdApp to be Nothing and then the header was accessible again. Think I take it away and try my templates without for a while before I publish them.
Now back to work again, have a lot of other things to do!! “Templates” is only a hobby.
Best regards
Bj -
WSbjoeng
AskWoody LoungerThanks for the code. It works.
(Whats BTW?)By the way i discovered that the following feature is available in VBA, by looking in help and searching for Document and under New Events:
WindowBeforeDoubleClick Event
Occurs when the editing area of a document window is double-clicked, before the default double-click action.
Syntax:
Private Sub object_WindowBeforeDoubleClick(ByVal Sel As Selection, ByVal Cancel As Boolean)object: An object of type Application declared with events in a class module. For more information about using events with the Application object, see Using Events with the Application Object.
I tried it but it did not work at once. may be someone has tried this before?
Best regards
Bj -
WSbjoeng
AskWoody LoungerHi Gary,
Thanks again for your comments and suggestion. I have tried it out and it works. regarding my problem it seems that I had missed out the procedure for closing the document. It looks as the wdApp must be set to nothing when the document closes.
Any way now it works at least on the ones I have tried it out on. It remains to update some other templates in order to get them updated with this functionality.
Regarding my template: It is more than 100kb and I have therefore ziped it and tried to attach it here but I was not allowed. Can’t understand why because the ziped file is only 53 kb. If you would like to see the template I may need to mail it directly to you. Can I find your mail address here on the lounge?
Please feel free to comment.
Best regards
Bj -
WSbjoeng
AskWoody LoungerSorry the file is too big. I will amend it and then attach it later.
regards
Bj -
WSbjoeng
AskWoody LoungerHi Gary,
Thanks for your sugestions. I will try it and think I might use it.
To my problem with the template:
The problem I only have on my PC at work. Siiting at home, like I do now, there seem to be no problem. But if I change some code in the template when I am using it creating a document it very often turns out that it will not work.
I’m not a programmer in VBA, only trying to adjust what others have done. So e.g. I’m not sure what wdApp contains or whether it ony is a variable without any properties. I will contact some people tpmorrow and try to find out.
I have attached the template file here. You will also see that it contains other code that has the purpose of beeing able to retreave what was typed in the different text boxes in the dialog box. Try it out and see if it is doing any harm to the protection of the header.
I hope I will be able to find out what causes the problem at work.
Best regards
Bj
-
WSbjoeng
AskWoody LoungerEdited by gwhitfield on 20-Jul-01 20:51.
Markup tags added
Hi Charles,
The code I pasted into my first message I now have found out that I got it from the following site, an MVP site by Bill Coan:
http://www.mvps.org/word/FAQs/Customizatio…d2000Header.htm
If this code is inserted as said in the article it will work. But, I have to show a Dialog Box when the template is started and therefore I put a code(frmNotatEn.Show) to start the Dialog Box in the rutine “Private Sub Document_New()”. By doing so the protection does not function any more.
I continue looking for an other way of having the Dialog Box open when I generate a new document based on this template.
(My template is such designed that the dialog box can be retreaved after the new .doc document is saved. The Dialog Box then contains the text I typed in the text boxes the first time. This gives the user a possibility to change any mistakes or simly using the document in a simular situation)
If someone could test out the code and find a way of getting the dialog box appear, I would appreciate it very much.
Thanks
Best regards
Bj -
WSbjoeng
AskWoody LoungerHi,
Thanks for a quick answer.The VBA code that I inserted in my mail is placed in a template (e.g. Note-en.dot file) in the module “This Document”.
The template is used to generate a new file based on the template(standard way of generating a new file in Word). The new Document1 or after saving it as e.g. myfile.doc should then prevent users from accessing the header.
Sometimes it works , but mostly the header will be opened. No messages. After that the header is allways opened when double-clicking in the header area or opened via view/Header/Footer.Best regards
Bj
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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
-
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
1 hour, 53 minutes ago -
Stay connected anywhere
by
Peter Deegan
1 hour, 54 minutes ago -
Copilot, under the table
by
Will Fastie
31 minutes ago -
The Windows experience
by
Will Fastie
45 minutes ago -
A tale of two operating systems
by
Susan Bradley
39 minutes ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
4 hours ago -
Where’s the cache today?
by
Up2you2
19 hours, 21 minutes ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
12 hours, 6 minutes ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
3 hours, 5 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
20 hours, 2 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
1 day, 12 hours ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
1 day, 12 hours ago -
regarding april update and may update
by
heybengbeng
1 day, 14 hours ago -
MS Passkey
by
pmruzicka
16 hours, 7 minutes ago -
Can’t make Opera my default browser
by
bmeacham
1 day, 21 hours ago -
*Some settings are managed by your organization
by
rlowe44
1 day, 8 hours ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
1 day, 20 hours ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
2 days, 16 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
3 days, 1 hour ago -
AI slop
by
Susan Bradley
19 hours, 22 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
3 days, 2 hours ago -
Two blank icons
by
CR2
10 hours, 55 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
12 hours, 53 minutes ago -
End of 10
by
Alex5723
3 days, 14 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
2 days, 12 hours ago -
test post
by
gtd12345
3 days, 20 hours ago -
Privacy and the Real ID
by
Susan Bradley
3 days, 10 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day, 12 hours ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
4 days ago -
Upgrading from Win 10
by
WSjcgc50
2 days, 12 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.