-
WSDaveW
AskWoody LoungerThanks Hans, I should have thought of that. (Probably would have, eventually; but assumed there would be a checkbox somewhere to uncheck, after which all would behave as it used to).
It’s just so much like when your local supermarket rearranges all the shelves just when you’ve got used to where things are… -
WSDaveW
AskWoody LoungerThanks HansV, I’ve printed off Dave Rado’s article (I’ve found his articles to be v. useful in the past), and it looks like there’s stuff I can play with here that should increase speed. There’s certainly a suggestion that if I select a cell in column 1, then select the column, and work with the cells in the selection, that should be faster. I’ll try some of these things out and post an update when I see what happens!
(Unfortunately the best time for me to concentrate on this sort of stuff is on my machine at home – when *anything* runs pretty fast… but then I have to bring it all back in to work, whereupon I find out what’s genuinely fast and what isn’t!!) -
WSDaveW
AskWoody Lounger(Edited by jscher2000 on 16-Jul-03 15:47.
and
markup added around code snippet to preserve indenting.)
Hi guys:
Though the code for applying/retrieving the hidden property is now sorted, after a couple of days not working with the document I’ve now gone back in and found that populating the listbox in the first place is running unbelievably slowly.
Here’s an idea of the structure of the table, then I’ll show the code I’ve got populating the listbox: can anybody see how I might make it run *way* faster?
Table has 3 columns. All the text in cols 2 and 3 is formatted with a style called “response”. In the first column, some rows have text in “Matrix 1” style (these are ‘section headings’ within the table), others have text in “Matrix 2” style (these are items under the headings). Matrix 1 and Matrix 2 styles are outline numbered (1, 2, 3 for Matrix 1; 1.1, 1.2 etc for Matrix 2).
First part of the code for populating the listbox (slow running part):Dim iRow As Row, i As Integer, j As Integer, aRange As Range i = 1 j = 1 With ActiveDocument.Tables(1) For Each iRow In .Rows Set aRange = iRow.Cells(1).Range aRange.TextRetrievalMode.IncludeHiddenText = True If aRange.Paragraphs(1).Style = "matrix h1" Then LstSections.AddItem Left(aRange.Paragraphs(1).Range.Text, _ Len(aRange.Paragraphs(1).Range.Text) - 2) LstSections.List(j - 1, 1) = i j = j + 1 End If i = i + 1 Next iRow '(more code to SELECT items in the list if the corresponding part ' of the table is not formatted as hidden text, then: ) End With
(Note: I’m chopping off the last two characters in each range because it’s in table cells and I don’t want the para mark or cell division character, etc.)
-
WSDaveW
AskWoody LoungerYes; thanks to you both for these inputs. I think I’ve got a working solution now: I’ve added a second column to the listbox, and put in it the row number where the specified style occurs. So if the style is on rows 1, 12, and 22 (for example) the listbox has items:
blah blah blah | 1
more blah blah | 12
yet more blah | 22. (etc.)
…Then according to whether the item is checked or not I can set rows 1-11, 12-21 or 22-.count as hidden or not hidden.
Because I’m looking at the styles now, this will still work if users add their own “sections” to the table (which it didn’t when I was relying on bookmarks). -
WSDaveW
AskWoody LoungerAha; thanks HansV, I didn’t know that.
Yes, I’ve checked the paragraphs.count for each of the bookmarked ranges in the table, and – you’re right – the ones that give trouble have 70 paragraphs in them.
So perhaps what I need to do is *not* have a bookmark that encompasses the whole range to be considered, but one that marks the start, another that marks the end, and have the code just ask about the .hidden property of the starting bookmark, then work with a range that’s defined as eveything between the two?
Heck: thinking as I type, since the first row of each range (and only the first – so at maximum 3 paragraphs, one for each cell in that row) is formatted with a specific style, maybe I should find some way to scrap the bookmarks altogether and identify the ranges according to style, and determine the .hidden property as it’s applied to each occurrence of that style. Hmm… -
WSDaveW
AskWoody LoungerStrangely, I now can’t get it to replicate the problem – works fine now! (Though it WAS doing it all the time… must’ve been some specific set of circumstances, but I’m blown if I can work out what). Hmm… Anyway, no I wasn’t running TweakUI on my home machine either, but I’ve kept hold of that code snippet in case it leaps up again. Sorry to have troubled you guys with a problem that seems to have gone away of its own accord!
(If only they were all like that, huh?) -
WSDaveW
AskWoody LoungerI’ve just tried the code on a different machine: at work we’re on Win2000 (definitely no TweakUI!), and it does what it’s supposed to, the way it’s expected to (which is the main thing, really, since it’ll be used at work when it’s all sorted out). On my machine at home (which was exhibiting the problem) I have WinXP, and possibly (I can’t recall offhand) TweakUI. I’ll have a look into it.
In the meantime, I’ll also have a go with Gary’s code, see if that makes a difference.
Thanks guys, I’ll report back with the outcome (one way or the other!)… -
WSDaveW
AskWoody LoungerThe code’s running from a Word global template.
To create the document:
Dim DocReport as Document
(…code…)
Set DocReport = Documents.Add(Template:=ThisDocument.FullName) ‘note I didn’t set visibility either wayLater, to activate the document:
DocReport.activateNo, I didn’t turn off screenupdating.
HTH -
WSDaveW
AskWoody LoungerReading this thread with interest, I wondered: is this problem related at all to the one I experience? – Namely, that if I have some text (either on the page or in a text box), and I cut it to the clipboard, then do “paste as picture”… it often pastes as a “picture of some TNR text” even if my cut text was in Arial (which it usually is).
-
WSDaveW
AskWoody LoungerJune 27, 2002 at 7:48 am in reply to: document_open macros when opened via intranet (wd2000) #597438Thanks Jefferson:
I’ll study the threads about vbscript solutions when I have time & opportunity to really take them in (!) but the method from the KB article seems to do the trick so I might go with that, at least as an interim measure.
(Of course, ‘other weirdness’ includes that the users might get frustrated by the lack of their familiar Word editing toolbars etc.: it’ll at least prompt ’em to save the document locally and get out of the browser. hmmm…) -
WSDaveW
AskWoody LoungerYes, doing a quick bit of testing it looks like you’re right, Stuart.
I’ll rip out those extra lines since all they seem to be doing is slowing things down a little. Odd, i’m sure I had them in there for a reason, just can’t for the life of me think what it was…
Another thing spotted during testing: switching views from Page to Normal and then back SEEMS to force Word to update all fields without us manually cycling through them: can anyone confirm that this holds true for multiple-sections, etc. etc. (could be a useful sideways solution?) -
WSDaveW
AskWoody LoungerHmm, as an aside, I’ve had this requirement for a long while too (you’d think updating all fields would be built in, like toggle all fields is, but there we go…), and the code I cobbled together (probably from stuff out of this MB or otherwise Woody’s books) was:
Public Sub UpdateAllFields()
If Not Documents.Count = 0 Then
Dim aStory As Range
For Each aStory In ActiveDocument.StoryRanges
While Not (aStory Is Nothing)
aStory.Fields.Update
Set aStory = aStory.NextStoryRange
Wend
Next aStory
End If
End SubThis seems to have been sufficient for my needs: does it miss out some fields and I just failed to notice them? (I must admit that since my docs are single-sided I have fewer encounters with the multiple versions of headers & footers)…
dtw
-
WSDaveW
AskWoody LoungerThe square dot is quite useful actually: it’s an indication that the paragraph has one of the following applied (either manually or from its underlying style) to it: (a) keep lines together, (
keep with next, © page break before.
Like most formatting characters, you’re usually better off learning to appreciate it for what it is than wanting to get rid of it.
HTH
![]() |
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
-
DuckDuckGo’s Duck.ai added GPT-4o mini
by
Alex5723
6 minutes ago -
Trump signs Take It Down Act
by
Alex5723
8 hours, 5 minutes ago -
Do you have a maintenance window?
by
Susan Bradley
18 minutes ago -
Freshly discovered bug in OpenPGP.js undermines whole point of encrypted comms
by
Nibbled To Death By Ducks
9 hours, 39 minutes ago -
Cox Communications and Charter Communications to merge
by
not so anon
11 hours, 25 minutes ago -
Help with WD usb driver on Windows 11
by
Tex265
16 hours, 34 minutes ago -
hibernate activation
by
e_belmont
20 hours, 20 minutes ago -
Red Hat Enterprise Linux 10 with AI assistant
by
Alex5723
1 day ago -
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
1 day, 3 hours ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
1 day, 3 hours ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
1 hour, 19 minutes ago -
Out of band for Windows 10
by
Susan Bradley
1 day, 7 hours ago -
Giving UniGetUi a test run.
by
RetiredGeek
1 day, 14 hours ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
1 day, 22 hours ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
8 hours, 34 minutes ago -
Auto Time Zone Adjustment
by
wadeer
2 days, 3 hours ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
2 days ago -
Manage your browsing experience with Edge
by
Mary Branscombe
9 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
17 hours, 42 minutes ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
1 day ago -
Apps included with macOS
by
Will Fastie
21 hours, 58 minutes ago -
Xfinity home internet
by
MrJimPhelps
18 hours, 45 minutes ago -
Convert PowerPoint presentation to Impress
by
RetiredGeek
1 day, 20 hours ago -
Debian 12.11 released
by
Alex5723
3 days ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
3 days, 3 hours ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
2 days, 7 hours ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
10 hours, 56 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
3 days, 20 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
3 days, 11 hours ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
1 day, 8 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.