-
WSpieter
AskWoody Loungerhi Kyle,
the following seems to work for me.
Function NumberOfPagesInSection _
( _
ByRef CurrentSection As Section _
) As Long
Dim StartSectionPage As Long
Dim EndSectionPage As Long
With CurrentSection
EndSectionPage = _
.Parent.Range _
( _
.Range.End – 1, _
.Range.End _
).Information(wdActiveEndPageNumber)
StartSectionPage = _
.Parent.Range _
( _
.Range.Start, _
.Range.Start _
).Information(wdActiveEndPageNumber)
End With
NumberOfPagesInSection = _
EndSectionPage – StartSectionPage + 1
End Functionyou can call the function for instance as follows:
msgbox NumberOfPagesInSection(activedocument.Sections(3))greetings,
-
WSpieter
AskWoody Loungerjust an update.
one week ago, the problem just disappeared – no more warnings for over a week now – how smart can smart get!
it’ll probably come back to stab me in the back i guess.
i was wondering if standby puts more strain on the hd. since i received the warnings, i have powering down the computer every night in stead of going in standby mode.greetings,
-
WSpieter
AskWoody Loungerhi Leigh,
assuming textbox2 is the last textbox on the first page, the following code will move to the next page with focus on the first control of that page :
Private Sub TextBox2_KeyDown _
( _
ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer _
)
If KeyCode = 9 Then MultiPage1.Value = 1
End Subbe aware that this will trigger the change event of the multipage, so any code you have placed in that event handler could possibly interfere with the first textbox receiving focus. you could create a userform level boolean variable to prevent any code in the multipage change event from being executed :
private NoMPChangeEvent as boolean
Private Sub TextBox2_KeyDown _
( _
ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer _
)
If KeyCode = 9 Then
NoMPChangeEvent=true
MultiPage1.Value = 1
NoMPChangeEvent =false
end if
End SubPrivate Sub MultiPage1_Change()
if NoMPChangeEvent then exit sub
‘rest of your code
End Subgreetings,
-
WSpieter
AskWoody LoungerApril 21, 2003 at 2:57 pm in reply to: Caller of a DocumentBeforePrint event (Word 2000 SR-1) #670029hi Marcel,
explore the actioncontrol property of the commandbars collection.
greetings,
-
WSpieter
AskWoody Loungerthanks Bob!
unfortunately, this won’t work for me as i’m using NTFS on win XP. nevertheless, the grc site is highly recommendable!
greetings,
-
WSpieter
AskWoody Loungerthanks All for the advice and the links.
in the mean time i’ve downloaded a diagnostics program from maxtor’s site (powermax) and this seem to indicate the problem is genuine (and not a call from mother dell). there’s a remote chance the more elaborate tests the program provides will succeed in repairing my disk, but i’m just going to wait and see what happens for the moment, since this has no impact for the moment on performance and file storage integrity afaics. (still more than a year of warranty)
my next ‘puter will definitely be self assembed again, those brand computers are a maintain, upgrade and security nightmare, their performance mediocre at best. ok dell is cheap, i’ll grant em that.
greetings,
-
WSpieter
AskWoody Loungerhi,
please post your code so we can investigate
in the mean time i will make a WAG (a crystal ball smilie would be appropriate here)
you can put code either in the document_new event sub of the thisdocumentclass module, with calls to external subs or functions if necessary, or you can put it all in a module (the sub that executes when you start a new document from the template must be called autonew, and be public)
there is a small problem with userforms. if you start a new document bases on a template for which you previously already created a new document that is still opened, the userform sometimes duplicates the values of the controls that you typed in when you created the first document. this is because when you use the userform1.show method, a hidden global instance of the form is created, which sometimes causes the userform to retain its control values when you leave a previously created document opened. to prevent this, declare a local userform object variable and then instatiate the userform by means of this variable. here’s some small example code to demonstrate (premise : your userform is called ‘Userform1’):
sub InstantiateLocalisedUserform()
dim MyLocalUserform as Userform1
set mylocaluserform=new userform1
mylocaluserform.caption=”it seems to work now.”
mylocaluserform.show
end subofcourse, you can put this code in the document_new() event sub of the thisdocument class module of the template.
greetings,
-
WSpieter
AskWoody Loungerhi Kay,
protect your document for track changes through the word menu tools->protect document->(track changes)
greetings,
-
WSpieter
AskWoody Loungerhi Kevin,
i’m not sure. first see if you have this problem with all templates, if that’s the case then maybe it is indeed word’s installation procedure gone wrong.
but there are a few things to try first.open your template
examine its fileformat with ?activedocument.saveformat
is it 0 for a standard document (probably) or is it 1 (template)
if it’s 1 and it still tries to save as a standard doc, then something might be wrong with word’s installation.
what do you get if you try this for another template (say one of microsofts standard templates)
also try to resave it with the following
activedocument.SaveAs filename:=activedocument.AttachedTemplate.fullname, fileformat:=wdformattemplate
if nothing else helps, you could try the /regserver switch.greetings,
-
WSpieter
AskWoody LoungerMarch 6, 2003 at 6:38 pm in reply to: Separators in Multi-Language Environments (VBA/Office2000/Word2000) #659261hi Hubert,
word 2002.
msgbox application.International(wdListSeparator)
msgbox application.International(wdDecimalSeparator)
msgbox application.International(wdThousandsSeparator)greetings,
-
WSpieter
AskWoody Loungerhi,
without seeing a sample of your document i cannot guarantee 100% this will work, but try this:
Sub DeleteBadLines()
Application.ScreenUpdating = False
Dim BadLine As Long
With ActiveDocument
For BadLine = .Paragraphs.Count To 1 Step -1
If Left(.Paragraphs(BadLine).Range.Text, 1) = “)” Then
.Paragraphs(BadLine).Range.Delete
End If
Next
End With
Application.ScreenUpdating = True
End Subgreetings,
-
WSpieter
AskWoody Loungerhi,
this is somewhat cludgy, but it may suit your needs.
work with two documents.
1. you protect the actual document with a password on the document level (so they’re prompted for a password when they try to open it directly)
2. created a second document with a protected VBA project that will act as the loader object. the code simply opens the real passwordprotected document. Now if they open with disabled macros, the document they want will not be loaded – they have to enable macros! ofcourse you inform them of this in your loader document.ps. if they have a commercially available passwordcracker to crack the vba password, they’ll see the document password also and gain access that way to the actual document, but i don’t think this should cause any problems in your situation. (this has nothing to do with the question, but as a sidenote : the two document scenario was originally an idea of mine to create a true read only document (yes i still think this is possible) using only word.)
greetings,
-
WSpieter
AskWoody Loungeror you can put the code that is in your autonew and put it in the Document_New() sub of the thisdocument clas module of the template (see picture)
have word create the procedure stub for you by unsing the comboboxes on top (doubleclick ThisDocument in the project explorer, choose “Document” in the left drop down combobox and “New” in the right)greetings,
-
WSpieter
AskWoody Lounger(No Text)
-
WSpieter
AskWoody Loungerhi Kyle,
create a sub with the same name of the word command:
Sub ToolsRevisionMarksToggle()
MsgBox “sorry, you cannot toggle the revisionmarks status!”
End Subhere’s the list of interceptable commands : http://www.mvps.org/word/FAQs/General/CommandsList.htm
greetings,
![]() |
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
-
Windows 11 Insider Preview build 27871 released to Canary
by
joep517
8 hours, 23 minutes ago -
Windows 11 ad from Campaign Manager in Windows 10
by
Jim McKenna
5 hours, 43 minutes ago -
Small desktops
by
Susan Bradley
5 hours, 49 minutes ago -
Totally disable Bitlocker
by
CWBillow
6 hours, 45 minutes ago -
Phishers extract Millions from HMRC accounts..
by
Microfix
6 hours ago -
Windows 10 22H2 Update today (5 June) says up-to-date but last was 2025-04
by
Alan_uk
1 day, 12 hours ago -
Thoughts on Malwarebytes Scam Guard for Mobile?
by
opti1
5 hours, 56 minutes ago -
Mystical Desktop
by
CWBillow
1 day, 15 hours ago -
Meta and Yandex secretly tracked billions of Android users
by
Alex5723
20 hours, 56 minutes ago -
MS-DEFCON 2: Do you need that update?
by
Susan Bradley
7 hours, 33 minutes ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
2 days, 6 hours ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
2 days, 9 hours ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
2 days, 7 hours ago -
What is wrong with simple approach?
by
WSSpoke36
5 hours, 51 minutes ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
2 days, 19 hours ago -
Location, location, location
by
Susan Bradley
1 day, 9 hours ago -
Cannot get a task to run a restore point
by
CWBillow
2 days, 20 hours ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
2 days, 11 hours ago -
June 2025 Office non-Security Updates
by
PKCano
3 days, 7 hours ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
1 day, 9 hours ago -
Firefox Red Panda Fun Stuff
by
Lars220
3 days, 7 hours ago -
How start headers and page numbers on page 3?
by
Davidhs
3 days, 17 hours ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
2 days, 20 hours ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
4 days, 2 hours ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
4 days, 2 hours ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
3 days, 16 hours ago -
Firefox 139
by
Charlie
3 days, 8 hours ago -
Who knows what?
by
Will Fastie
2 days, 11 hours ago -
My top ten underappreciated features in Office
by
Peter Deegan
13 hours, 39 minutes ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
1 day, 20 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.