-
WSJanB
AskWoody LoungerI don’t know is this is related to your problem, but today one of our users converted a Word 97 document to PDF (with Adobe’s PDF Writer) and found out that about half a page of text was missing. After taking a close look, I discovered that the problem was caused by unprintable characters used as bullets in a 4-paragraph part of the document. Correcting this solved her problem.
-
WSJanB
AskWoody LoungerHi Stuart,
I don’t agree, because when nothing is copied into the doc and no error message is shown, the user will tend to call the help desk…
So you have to cater for that. The reason I didn’t include that in my previous post is, that all my messages are in Dutch and I had not much time to spent translating. So here comes the complete code:Public Sub PastePlainText
On Error Goto Error_Handler
If Documents.Count > 0 then
Selection.PasteSpecial DataType:=wdPasteText
End IfExit_Error:
Exit SubError_Handler:
Select Case Err.Number
Case 4605
MsgBox “There’s nothing on the Clipboard…”, vbInformation + vbOKOnly
Case 4198, 5342
MsgBox “The contents of the Clipboard cannot be pasted as plain text.”, vbInformation + vbOkOnly
Case Else
MsgBox “Error : ” & Err.Number & vbCrLf & “Description: ” & Err.Description, vbInformation + vbOkOnly, “PastePlainText”
End Select
Resume Exit_Error
End SubThe Exit_Error bit is there to always create a single point of exit for a Sub/Function. On many occasions some code sits between the Exit_Error and Exit Sub lines. E.g. turning on document protection if that was turned off earlier in that Sub, to avoid problems with documents containing FormFields.
-
WSJanB
AskWoody LoungerThanks Jefferson!
-
WSJanB
AskWoody LoungerThanks Jefferson!
-
WSJanB
AskWoody LoungerYou could “hijack” all the disabled menu-entries in a protected form, by writing macro’s with the exact same name as the built-in Word commands. Word then executes your macro instead of the built-in command. In these macro’s you can use the standard Word dialogs. It’s laborious, but it works. Example:
Public Sub FilePrint()
If Documents.Count > 0 Then ‘Sub generates error if no doc exists
Dialogs(wdDialogFilePrint).Show
End If
End SubIn Word XP / 2003 you also could use a different approach, with the WindowSelectionChange event (see post 342898 from HansV). I’m not sure whether or not that event is available in Word 2000.
-
WSJanB
AskWoody LoungerYou could “hijack” all the disabled menu-entries in a protected form, by writing macro’s with the exact same name as the built-in Word commands. Word then executes your macro instead of the built-in command. In these macro’s you can use the standard Word dialogs. It’s laborious, but it works. Example:
Public Sub FilePrint()
If Documents.Count > 0 Then ‘Sub generates error if no doc exists
Dialogs(wdDialogFilePrint).Show
End If
End SubIn Word XP / 2003 you also could use a different approach, with the WindowSelectionChange event (see post 342898 from HansV). I’m not sure whether or not that event is available in Word 2000.
-
WSJanB
AskWoody Lounger> “find the best way to determine if a table contains a nested table”
I’m very interested too. In Word 2003 I nested table(2) into table(1) and ActiveDocument.Tables.Count produced just 1 !
So using a For Each loop through the tables won’t work. -
WSJanB
AskWoody Lounger> “find the best way to determine if a table contains a nested table”
I’m very interested too. In Word 2003 I nested table(2) into table(1) and ActiveDocument.Tables.Count produced just 1 !
So using a For Each loop through the tables won’t work. -
WSJanB
AskWoody LoungerI use a simple macro for that purpose too:
Sub PastePlainText
If Documents.Count > 0 Then
Selection.PasteSpecial DataType:=wdPasteText
End If
End SubI assigned Alt+V to this macro in order to preserve the normal use of Ctrl+V.
-
WSJanB
AskWoody LoungerI use a simple macro for that purpose too:
Sub PastePlainText
If Documents.Count > 0 Then
Selection.PasteSpecial DataType:=wdPasteText
End If
End SubI assigned Alt+V to this macro in order to preserve the normal use of Ctrl+V.
-
WSJanB
AskWoody LoungerHi Macropod,
I think too that this is a very nice piece of work.
Provided your Windows is configured to use “,” for grouping on thousands and “.” for decimals, that is. But in Holland it’s the other way around, so I get syntax errors all over the place in my Dutch version of Word 2003.
Is there a simpel way to make the formulae behave correctly indepent of this Windows configuration? Or is that only possible by replacing every “,” with “.” an vice versa? -
WSJanB
AskWoody LoungerHi Macropod,
I think too that this is a very nice piece of work.
Provided your Windows is configured to use “,” for grouping on thousands and “.” for decimals, that is. But in Holland it’s the other way around, so I get syntax errors all over the place in my Dutch version of Word 2003.
Is there a simpel way to make the formulae behave correctly indepent of this Windows configuration? Or is that only possible by replacing every “,” with “.” an vice versa? -
WSJanB
AskWoody LoungerThere’s another workaround that works fine in Word 97, XP and 2003 (don’t have 2000):
ActiveDocument.Bookmarks(“TxtTarget”).Range.Fields(1).Result.Text = “Here comes the text.”
Sometimes you cannot select the formfield with ActiveDocument.FormFields(“TxtTarget”).Select.
If the formfield is of Type wdFieldFormTextInput then this always does the trick:ActiveDocument.Bookmarks(“TxtTarget”).Range.Fields(1).Result.Select
I found this workarounds once on the mvps site .
To make these work nice, I’ve put them in “wrappers”
Public Sub SetValueFF(vName As Variant, sValue As String)
If ActiveDocument.Bookmarks.Exists(vName) Then
ActiveDocument.Bookmarks(vName).Range.Fields(1).Result.Text = sValue
End If
End SubPublic Sub SelectFF(vName As Variant)
With ActiveDocument
If .Bookmarks.Exists(vName) Then
If .FormFields(vName).Type = wdFieldFormTextInput Then
.Bookmarks(vName).Range.Fields(1).Result.Select
Else
.FormFields(vName).Select
End If
End If
End With
End SubRegards
JanB -
WSJanB
AskWoody LoungerThere’s another workaround that works fine in Word 97, XP and 2003 (don’t have 2000):
ActiveDocument.Bookmarks(“TxtTarget”).Range.Fields(1).Result.Text = “Here comes the text.”
Sometimes you cannot select the formfield with ActiveDocument.FormFields(“TxtTarget”).Select.
If the formfield is of Type wdFieldFormTextInput then this always does the trick:ActiveDocument.Bookmarks(“TxtTarget”).Range.Fields(1).Result.Select
I found this workarounds once on the mvps site .
To make these work nice, I’ve put them in “wrappers”
Public Sub SetValueFF(vName As Variant, sValue As String)
If ActiveDocument.Bookmarks.Exists(vName) Then
ActiveDocument.Bookmarks(vName).Range.Fields(1).Result.Text = sValue
End If
End SubPublic Sub SelectFF(vName As Variant)
With ActiveDocument
If .Bookmarks.Exists(vName) Then
If .FormFields(vName).Type = wdFieldFormTextInput Then
.Bookmarks(vName).Range.Fields(1).Result.Select
Else
.FormFields(vName).Select
End If
End If
End With
End SubRegards
JanB -
WSJanB
AskWoody LoungerWe are upgrading from Office 97 to Office 2003 too. We’ve developed a lot of “intelligent” templates in Word, which are dynamically built based on user choices, in dropdown formfields or with a commandbarbutton. That requires quite some VBA code, put in a single code-template that sits in the Word Startup directory. None of the other templates contains any code at all.
Loading the code-template in Word 2003 caused only a couple of problems and some minor inconveniences.
Word 97 VBA only has 1 event on application level that you can use to control opening documents by users: DocumentChange. This event fires whenever user creates or opens a document or changes to another document (menu Window). Loaded in Word 2003 the event-handling Sub wdApp_DocumentChange is run several (up to 32!) times before it triggered the rest of the code. And when you try to create a new document from a template, the event-handler goes into an endless loop… I haven’t found a reason, nor a solution / workaround for this. Apparently this event doesn’t work exactly the same as in Word 97. So I had to convert to 2 events which are not in Word 97 VBA: NewDocument and DocumentOpen. And that worked fine. But it means that I have to maintain 2 versions of my code template until our last user is upgraded to Office 2003.The second problem is hijacking menu entries and commandbar buttons the way it was done. If you do that properly (using the same name as the built-in Word command for your Sub) then you don’t have a problem. But unfortunately in the early days we didn’t know that and used dutch names for our own routines. And replaced the standard menu entries and commandbar buttons with ones that pointed to the Sub’s we created. Because the menubar in Word 2003 is organised differently, some entries showed up twice or even three times. So we decided to rename our Sub’s to match the built-in names and restore the original menubar and commandbar Standard.
Then there is this is strange behaviour of AutoText fragments that are saved with the template and placed in a document by VBA code. These fragments can contain both plain text and formfields. On some (!) PC’s the plain text was in Arial, as intended, but for the formfields the (ugly!) font MS Mincho was used. We can’t figure out why this happens. Eventually we decided to delete this font (present in both Windows XP and Office 2003 CAB files) from all PC’s. After that, Word used Arial Unicode MS for the formfields. But because there’s no visible difference with standard Arial, we can live with that.
The first mouseclick on a control in a dialog panel didn’t always do what you expect. It looks like the panel you just put on the screen (.Show) didn’t set the focus on the panel and that the first mouseclick just does set the focus on the panel. So you have to click again to fire the code behind the clicked control. We observed this both in Word XP (almost every time) and in Word 2003 (about fifty-fifty) when Windos XP Pro (dutch) and Office XP/2003 Enterprise Edition (dutch)were installed out-of-the-box. After a complete re-install of the PC’s, with all the latest patches for both Windows and Office applied, this problem seems to be solved. We never found out why it occurred in the first place.
Pagenumbering (page x of y) still is not perfect. At first we removed all code for updating the y-value because we thought that this was – finally – solved in Word XP / 2003. But in some cases we again encounterd document with the 1 of 1, 2 of 1, 3 of 1, etc. numbering. So we put the removed code back in…
The last issue I’d like to mention is that creating and opening documents takes more time in Word 2003 than it did in Word 97, up to 4x slower. These observations were made on a 2.53 Mhz Pentium 4 with 256 Mb memory and only Windows and Office installed.
Regards,
JanB
![]() |
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
-
*Some settings are managed by your organization
by
rlowe44
4 hours, 33 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
6 hours, 47 minutes ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
7 hours, 12 minutes ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
16 hours, 12 minutes ago -
AI slop
by
Susan Bradley
15 hours, 23 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
17 hours, 29 minutes ago -
Two blank icons
by
CR2
3 hours, 2 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
1 day, 2 hours ago -
End of 10
by
Alex5723
1 day, 5 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
2 hours, 58 minutes ago -
test post
by
gtd12345
1 day, 11 hours ago -
Privacy and the Real ID
by
Susan Bradley
1 day, 1 hour ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
17 hours, 18 minutes ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
1 day, 15 hours ago -
Upgrading from Win 10
by
WSjcgc50
3 hours, 8 minutes ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
6 hours, 41 minutes ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
2 days, 7 hours ago -
The story of Windows Longhorn
by
Cybertooth
1 day, 18 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
2 days, 9 hours ago -
Are manuals extinct?
by
Susan Bradley
2 hours, 44 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
2 days, 18 hours ago -
Network Issue
by
Casey H
2 days, 5 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
3 days, 6 hours ago -
May 2025 Office non-Security updates
by
PKCano
3 days, 6 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
3 days, 8 hours ago -
pages print on restart (Win 11 23H2)
by
cyraxote
2 days, 9 hours ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
3 days, 10 hours ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
3 days, 10 hours ago -
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
3 days, 18 hours ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
3 hours, 13 minutes 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.