-
WSForEachLoop
AskWoody LoungerNice thought. It doesn’t account for all the other punction marks (.,/- and such). Even if it did, this is just one of a number of cases.
-
WSForEachLoop
AskWoody LoungerTaking this one step further, Word has the convient template file that allows you to update code for all the template users just by switching out the template or making changes to it. Is there a similar feature in Excel?
The problem with having code in one file is that all users sharing that code have to be updated individually. Can an addin be used but tied into the WithEvents?
-
WSForEachLoop
AskWoody LoungerExcellent. Thanks!
-
WSForEachLoop
AskWoody LoungerThanks for the suggestions. I found it (forgetting that you can look at the HTML). It was looking for the following:
It does have to be on the same level as the calling file. I suspect there’s another file that does the same function, since my msohlp11.chm was in a odd place
-
WSForEachLoop
AskWoody LoungerMacropod, thanks for the code. Sorry for the delay. This did the trick and works well.
-
WSForEachLoop
AskWoody LoungerThat’s an excellent answer, an approach I had not thought of, if it were a simple table. However, these tables have merged rows and columns, so that code can’t be used. For the time being I tried something like this, adding up cell widths. Ugly and slow. Comments?
Code:Dim rightmostPosition As Long Dim rowWidth As Long Dim myCell As Cell Dim cellCount As Long Dim i As Long For i = 1 To ActiveDocument.Tables(1).Rows.Count cellCount = 1 rowWidth = 0 For Each myCell In ActiveDocument.Tables(1).Range.Cells If ActiveDocument.Tables(1).Range.Cells(cellCount).RowIndex = i Then 'myCell.Select rowWidth = rowWidth + ActiveDocument.Tables(1).Range.Cells(cellCount).Width End If cellCount = cellCount + 1 DoEvents Next If rowWidth rightmostPosition Then rightmostPosition = rowWidth End If DoEvents Next i
-
WSForEachLoop
AskWoody LoungerExcellent call. Thanks. I didn’t think to check that. It seems DocVerse was the culprit.
-
WSForEachLoop
AskWoody LoungerExcellent. Works like a charm.
Out of curiosity though, why does the original search add an extra line only to the last line?
-
WSForEachLoop
AskWoody LoungerExcellent. Thanks. I wouldn’t have come up with that.
-
WSForEachLoop
AskWoody LoungerJust listing them is good enough. From there I can get the owing instance. How would list all the open workbooks from among the Excel instances?
-
WSForEachLoop
AskWoody LoungerTrying to find all the open workbooks.
-
WSForEachLoop
AskWoody LoungerEven though Word does usually open in a single instance, the fact is you can still have multiple instances, so going through the documents list isn’t always going to catch all the documents.
Has anyone done this before, getting a specific instance from among all the running ones?
-
WSForEachLoop
AskWoody LoungerSo is there an example when this paste would make a difference?
I looked at the underlying XML (not binary) and there was no difference. However, I could see some times when it could be handy to copy from a Web page to Word and keep it as HTML, ocassionally as RTF, too.
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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
-
What is wrong with simple approach? (Awaiting moderation)
by
WSSpoke36
2 hours, 11 minutes ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
5 hours, 32 minutes ago -
June 2025 Office non-Security Updates
by
PKCano
8 hours, 45 minutes ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
1 hour, 26 minutes ago -
Firefox Red Panda Fun Stuff
by
Lars220
8 hours, 42 minutes ago -
How start headers and page numbers on page 3?
by
Davidhs
19 hours, 6 minutes ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
13 hours, 41 minutes ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
1 day, 3 hours ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
1 day, 3 hours ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
17 hours, 29 minutes ago -
Firefox 139
by
Charlie
10 hours, 5 minutes ago -
Who knows what?
by
Will Fastie
26 minutes ago -
My top ten underappreciated features in Office
by
Peter Deegan
1 day, 4 hours ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
22 hours, 55 minutes ago -
Misbehaving devices
by
Susan Bradley
14 minutes ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
2 days, 10 hours ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
7 hours, 49 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
2 days, 9 hours ago -
Discover the Best AI Tools for Everything
by
Alex5723
1 day, 8 hours ago -
Edge Seems To Be Gaining Weight
by
bbearren
1 day, 23 hours ago -
Rufus is available from the MSFT Store
by
PL1
2 days, 7 hours ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
3 days, 10 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
1 day, 10 hours ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
1 day, 8 hours ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
3 days, 5 hours ago -
Office gets current release
by
Susan Bradley
3 days, 8 hours ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
4 days, 22 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
4 days, 7 hours ago -
Stop the OneDrive defaults
by
CWBillow
4 days, 23 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
5 days, 9 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.