-
WSChris Green
AskWoody LoungerAhh. I see it now. When I first tested, I didn’t compile before testing. It was the compile time that caused the 9 to 4.5 second disparity. After compile, both your code and the stuff I wrote runs faster with For Each. Thanks.
-
WSChris Green
AskWoody LoungerThanks for responding, guys. Interesting little lesson, here.
I took my work machine home. Wanted to test on the same file. It’s got 48 tables, some of them rather long. It’s also got a lot of embedded graphics. Original file size over 5 Mb. I stripped out the graphics to get a svelte 450 Kb file so I could get it on floppy.
After stripping out the graphics, there’s no appreciable difference. A hundredth of a second or so between the two routines. It looks like graphics/file size really slows down the collection method (in this case, twice as long).
Also, I was surprised at the nominal difference between the two machines on the file without graphics. Home machine: Win 98 SE, AMD K3 600 MHz, 192 MB, Word 2K ran at 3.5 seconds. Work machine Win XP, P4 1.7 GHz, 512 MB, Word XP ran at 3.3 seconds.
Sub TestInc() Dim i As Integer, j As Integer Dim Begin: Begin = Timer Dim sngWid As Single For j = ActiveDocument.Tables.Count To 1 Step -1 sngWid = 6.5 / ActiveDocument.Tables(j).Columns.Count For i = 1 To ActiveDocument.Tables(j).Columns.Count ActiveDocument.Tables(j).Columns(i).Width = InchesToPoints(sngWid) Next Next MsgBox "It took " & Timer - Begin & " seconds." End Sub Sub TestFor() Dim oTab As Table Dim i As Integer, j As Integer Dim Begin: Begin = Timer Dim sngWid As Single For Each oTab In ActiveDocument.Tables sngWid = 6.5 / oTab.Columns.Count For i = 1 To oTab.Columns.Count oTab.Columns(i).Width = InchesToPoints(sngWid) Next Next MsgBox "It took " & Timer - Begin & " seconds." End Sub
-
WSChris Green
AskWoody LoungerHi Arild,
When you attach a new template, styles don’t automatically come over. Use the Organizer (Format>Styles>Organizer Button) to copy the styles from your template to the document..
HTH,
Chris
-
WSChris Green
AskWoody LoungerI tried from Outlook. The only mail merge I could find was using Contacts. I wanted to use an external data source. In fact, Outlook help leads you in the direction of using Word’s mail merge. Still baffled as to the rationale behind protected forms being *so* protected. 🙂
-
WSChris Green
AskWoody LoungerHi Ron,
How about creating another heading style (“Heading 2 w/ Page Break”) and setting the Page Break Before property?
HTH,
Chris
-
WSChris Green
AskWoody LoungerHi Kevin,
How about this?
-
WSChris Green
AskWoody LoungerHi Howard,
I’m aware of that. Perhaps I was unclear. My point was that you could use FileSearch to open only files with a .doc extension and a file type of template, eliminating the need to open every document and test its type from ActiveDocument.
Regards,
Chris
-
WSChris Green
AskWoody LoungerOr, use FileSearch to open the docs and set .FileName to “*.doc” and .FileType to msoFileTypeTemplates. That should target the offending files pretty well.
HTH,
Chris
-
WSChris Green
AskWoody LoungerNovember 7, 2001 at 4:04 pm in reply to: Remove Character Style but Leave Manual Formatting (2000) #550692Oop. I forgot it needs to work on a selection…
-
WSChris Green
AskWoody LoungerNovember 7, 2001 at 4:02 pm in reply to: Remove Character Style but Leave Manual Formatting (2000) #550691Aha! Now we’re gettin’ somewhere. Why use a dummy doc at all?
ActiveDocument.Styles("Testing").Delete ActiveDocument.Styles.Add Name:="Testing", Type:=wdStyleTypeCharacter With ActiveDocument.Styles("Testing") .Font.Color = wdColorBlue '.Font.etc = whatever End With
-
WSChris Green
AskWoody LoungerNovember 7, 2001 at 12:58 am in reply to: Remove Character Style but Leave Manual Formatting (2000) #550573Hi Lin,
I agree.
That’s why I said in the last post, “The replace with new character style seems much better. ”
I proposed the code as an exercise in near futility, as it’s so inefficient. Hopefully, one of the VBA Gurus can come up with something else.
Why come up with something else? JFinkle could create a new character style on which to base the replace. The old style had attributes of Hidden, Blue, and Italic. He creates a new character style of Not Hidden, Not Blue, and Not Italic. But, what if those attributes conflict with some of his paragraph styles? For example, an Italicized Heading style or a blue First Row Table style. In that case, the replace would cause problems with existing paragraph styles that had been modified with the old character style.
When I said the code used brute-force I was being generous. One would have to read and assign every font attribute they were concerned about. It then examines every character in a selection and sez, “If you’re the old character style, tell me everthing about the font I want to know, reset it to the paragraph style, and apply everything you told me about the font.” Usable. But not fun.
Chris
-
WSChris Green
AskWoody LoungerNovember 6, 2001 at 11:11 pm in reply to: Remove Character Style but Leave Manual Formatting (2000) #550561All I could think of off-hand was brute force. The replace with new character style seems much better.
But, if you’re interested, here’s a snippet. You’d have to read into the array the font attributes you want to preserve. There’s got to be a more elegant way, but I haven’t found it. It’ll be sloooooowww. Especially if you have a lot of text in that particular character style.
Sub ResetCharacter() ' Dim varFont(4) Dim oChar As Object Dim oStyle As Style For Each oChar In Selection.Characters If oChar.Style = "Testing" Then varFont(1) = oChar.Font.Bold varFont(2) = oChar.Font.Subscript varFont(3) = oChar.Font.Underline varFont(4) = oChar.Font.Superscript oChar.Font.Reset oChar.Font.Bold = varFont(1) oChar.Font.Bold = varFont(1) oChar.Font.Subscript = varFont(2) oChar.Font.Underline = varFont(3) oChar.Font.Superscript = varFont(4) End If Next MsgBox "Done" End Sub
-
WSChris Green
AskWoody LoungerNovember 6, 2001 at 7:01 pm in reply to: Remove Character Style but Leave Manual Formatting (2000) #550506I’m confused. You *don’t* want to remove text with the character style from the document.
Do you want to undo the character style without impacting manual formatting on other text in the paragraph?
What about a macro that aplies the ctrl+spacebar only to the character style? Mind you, if they apply manual formatting to the character style, you’ll lose it. But it’s better than losing all manual formatting.
Sub ResetCharacter() ' Selection.Find.ClearFormatting With Selection.Find .Style = "instructions" .Wrap = wdFindContinue Do .Execute Selection.Font.Reset Loop Until .Found = False End With End Sub
HTH,
Chris
-
WSChris Green
AskWoody LoungerNovember 6, 2001 at 6:21 pm in reply to: Remove Character Style but Leave Manual Formatting (2000) #550492Instruct users on how to (or create a macro to) use Find/Replace to replace style “Instructions” with nothing.
HTH,
Chris
-
WSChris Green
AskWoody LoungerNovember 5, 2001 at 9:20 pm in reply to: I have 20 people that use Term (Outlook 98, Excel 97) #550302Hi Daniel,
You might want to grab the install root value from the registry and append it to your shell string. For Office 97, I believe it’s HKEY_Local_MachineSoftwareMicrosoftOffice8.0CommonInstallRoot.
HTH,
Chris
![]() |
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
-
Hello Windows…My Problem is Windows Hello…
by
rdleib
26 minutes ago -
New Canon Printer Wants Data Sent
by
Win7and10
44 minutes ago -
I set up passkeys for my Microsoft account
by
Lance Whitney
3 minutes ago -
AI is for everyone
by
Peter Deegan
17 minutes ago -
Terabyte update 2025
by
Will Fastie
5 hours, 37 minutes ago -
Migrating from Windows 10 to Windows 11
by
Susan Bradley
4 hours, 42 minutes ago -
Lost sound after the upgrade to 24H2?
by
Susan Bradley
23 hours, 31 minutes ago -
How to move 10GB of data in C:\ProgramData\Package Cache ?
by
Alex5723
3 hours, 4 minutes ago -
Plugged in 24-7
by
CWBillow
9 hours, 28 minutes ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
1 day, 12 hours ago -
Have Copilot there but not taking over the screen in Word
by
CWBillow
1 day, 9 hours ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
3 days, 3 hours ago -
Are Macs immune?
by
Susan Bradley
1 day, 1 hour ago -
HP Envy and the Function keys
by
CWBillow
2 days, 11 hours ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
4 hours, 48 minutes ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
3 days, 15 hours ago -
Unable to update to version 22h2
by
04om
23 hours, 34 minutes ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
3 days, 22 hours ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
3 days, 22 hours ago -
Very Quarrelsome Taskbar!
by
CWBillow
3 days, 8 hours ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
4 days, 11 hours ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
4 days ago -
Is your battery draining?
by
Susan Bradley
6 hours, 27 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
1 day ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
4 days, 15 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
17 hours, 57 minutes ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
3 days, 23 hours ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
3 days, 16 hours ago -
National scam day
by
Susan Bradley
2 days, 23 hours ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
3 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.