-
WSForEachLoop
AskWoody LoungerThank you all for the good ideas. In each case, it sounds like there is a second table. That is a our workaround but I was curious if there was a case for one, dynamic table, since we don’t know which tables are going to expand or by how much.
-
WSForEachLoop
AskWoody LoungerHave you tried using the Table ‘header row’ property (Table Tools>Layout>Properties>Row)? Do note that there is no facility for adding anything like “(continued from previous page)”.
Thanks for the reply. I knew about that but was hoping there was something I missed.
-
WSForEachLoop
AskWoody LoungerI got around a little of this by reading the 2003 version’s RTF and 2007’s XML to get a list of revision authors. For our large, marked up documents, it was taking 45+ minutes to use conventional For loops just reading the Revisions to compile an author’s list; now it’s trivial, perhaps as long as 10 seconds. I still have the overhead of reading the revisions.
-
WSForEachLoop
AskWoody LoungerThanks! I like getting confirmation that the problem is actually an exception to the rule. Which segues to the next question. For Each Next is slow enough as it is, a For Next is even slower. In documents with a sufficiently large number of revisions, this process takes forever. Is there a way to get that Revision information into a memory structure, something like Revision.ToList() kind of thing?
-
WSForEachLoop
AskWoody LoungerThanks for the code! Perhaps not the ideal solution but it addresses it.
-
WSForEachLoop
AskWoody LoungerThanks! That is good to know. But that’s the very reason I want to find them programmatically: We shouldn’t be having direct-formatted modified named styles. It sounds like there is no way to programmatically find these deviations?
-
WSForEachLoop
AskWoody LoungerWe have Office 2007 with 64 Bit Windows 7. MODI doesn’t work with that, correct? Is there workaround, or replacement?
-
WSForEachLoop
AskWoody LoungerMy mistake. Apparently you shouldn’t mix old and new controls in the same form.
-
WSForEachLoop
AskWoody LoungerDelete that offending With section and the line “Selection.Borders(wdBorderVertical).LineStyle = wdLineStyleNone”.
wdBorderVertical is modified three times. The two With sections changing it are identical (so only the first is needed). While the other line changes the LineStyle, it would have been changed back later. Therefore, the last two references aren’t needed.
-
WSForEachLoop
AskWoody LoungerCould you restate the problem in anothe way or more clearly?
-
WSForEachLoop
AskWoody LoungerRethinking the approach a little for Word 2007+, if you made it a content control, had a content control in the text box, or used a Text box that already had a content control in it, you could use the Document’s ContentControlOnEnter event.
-
WSForEachLoop
AskWoody LoungerThanks for the confirmation!
-
WSForEachLoop
AskWoody LoungerHow about this (with only one uncommented Delete statement each time, and manually deleting all the lines before each run)? Only the last case deletes all the lines.
Code:Public Sub TestLines() On Error GoTo MyErrorHandler ‘Sets up a lot of lines Dim i As Long For i = 1 To 300 ActiveDocument.Shapes.AddLine 10, i * 2, 2000, i * 2 DoEvents Next Dim myShape As Shape For Each myShape In ActiveDocument.Shapes ‘myShape.Delete DoEvents Next Dim j As Long For j = 1 To 300 ‘ActiveDocument.Shapes(j).Delete DoEvents Next Dim k As Long For k = ActiveDocument.Shapes.Count To 1 Step -1 ‘ActiveDocument.Shapes(k).Delete DoEvents Next MsgBox “Shapes remaining: ” & ActiveDocument.Shapes.Count Exit Sub MyErrorHandler: MsgBox “TestLines” & vbCrLf & vbCrLf & “Err = ” & Err.Number & vbCrLf & “Description: ” & Err.Description End Sub
-
WSForEachLoop
AskWoody LoungerThanks! Adding the widths of the previous cells was the missing detail. It’s too bad that this information isn’t already in the table structure.
-
WSForEachLoop
AskWoody LoungerThat’s my point. This is finding the occurrence within a word. Can anyone confirm this is a bug, or seen it before, or have a workaround?
![]() |
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 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
2 hours, 38 minutes ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
2 hours, 44 minutes ago -
regarding april update and may update
by
heybengbeng
4 hours, 14 minutes ago -
MS Passkey
by
pmruzicka
18 minutes ago -
Can’t make Opera my default browser
by
bmeacham
11 hours, 54 minutes ago -
*Some settings are managed by your organization
by
rlowe44
1 hour, 11 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
10 hours, 48 minutes ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
1 day, 6 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
1 day, 15 hours ago -
AI slop
by
Susan Bradley
5 hours, 35 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
1 day, 16 hours ago -
Two blank icons
by
CR2
4 hours, 31 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
2 days, 1 hour ago -
End of 10
by
Alex5723
2 days, 4 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
1 day, 2 hours ago -
test post
by
gtd12345
2 days, 10 hours ago -
Privacy and the Real ID
by
Susan Bradley
2 days ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
2 hours, 50 minutes ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
2 days, 14 hours ago -
Upgrading from Win 10
by
WSjcgc50
1 day, 2 hours ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
1 day, 5 hours ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
3 days, 6 hours ago -
The story of Windows Longhorn
by
Cybertooth
2 days, 18 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
3 days, 8 hours ago -
Are manuals extinct?
by
Susan Bradley
8 hours, 43 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
3 days, 17 hours ago -
Network Issue
by
Casey H
3 days, 4 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
4 days, 5 hours ago -
May 2025 Office non-Security updates
by
PKCano
4 days, 5 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
4 days, 7 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.