-
WSjoelfinkle
AskWoody LoungerJanuary 24, 2013 at 11:27 am in reply to: Linked Excel data – keep repeating headers? (Word and Excel 2010) #1370606Hmm.. Do-able… I’d just need to start a new section for each such table so that the “real” header row on the Excel sheet uses a first-page header in Word, or else not paste/link the header row at all.
Still, it’s less than optimal: a change to the Excel sheet’s structure means I still have to manually muck with headers. This is yet another place where Microsoft falls down on consistency between Office apps (top of the list includes how to put line breaks in a paragraph/cell/presentation outline item)
-
WSjoelfinkle
AskWoody LoungerOh, and let me add that the Add-In does not cause crashes, throw errors, etc.
Even when the add-in isn’t installed, Word displays the message! -
WSjoelfinkle
AskWoody LoungerI figured it out: No, the styles were defined correctly with outline numbering.
The keystrokes Alt+Shif+Left and Alt+Shift+Right are defined to OutlinePromote and OutlineDemote.
The toolbar buttons do DecreaseIndent and IncreaseIndent.
All those commands are listed in Tools > Macro > Macros > All Word Commands.
If I redefine Alt+Shift+Left and +Right to do DecreaseIndent and IncreaseIndent instead — I get the results I want.
If you look at the online help for OutlinePromote, you’ll see it talks specifically about Heading 1-9 — not outline numbering.Stupid stupid Microsoft.
-
WSjoelfinkle
AskWoody LoungerThanks folks. My VBA skillz are pretty mad, but I’m lazy. If somebody else had done it before me, I’d pick it up. Googling on “Microsoft Word Style Report” was extremely unsuccessful due to how common those words are, so I tried here.
Looks like I’ll have to build it myself.
-
WSjoelfinkle
AskWoody LoungerActually, the first reply was better — it could be exported to a text file.
This is still just the style description.
But it’s still not tabular, and in my experience, Word chooses to drop things it thinks aren’t important, like numbering info, the font size if it’s common to lots of styles, etc. -
WSjoelfinkle
AskWoody LoungerPam,
All these years I’ve been working with Word, and I’ve never stumbled on the output from System Info.
It’s OK, but it’s still just the description.(plus some other stuff like the base style, following style).What I’d really like is more of a structured table: Font (tab) Font Size (tab) Italic (tab) Bold (tab)…….
Straight CSVs, XML, whatever, anything better than the flat text the .Description property creates, so long as every row had the same number of columns in the same places every time.Joel
-
WSjoelfinkle
AskWoody Loungerjscher — I think management knows it, their contractors that are doing the bulk of the work may have rose-colored glasses.
I managed to reproduce the behavior of the styles — I was wrong that the “alternates” numbered separately within Heading 1, they numbered continuously with Heading 2, except they are centered. So re-creating the styles as “Based On” Heading 2 reproduced the behavior I wanted.
What I found, though, is that a reset routine I’d written, that rebuilds the list templates (using named list templates to be bulletproof), reassigns all the text in the alternate styles to Heading 2 when the list template is assigned ot Heading 2. Disturbing that Word would do that without asking, as the alternate styles do not enter into it at all.
-
WSjoelfinkle
AskWoody LoungerI’ve tried copying the styles using both the Organizer for individuals, and the UpdateStyles method, neither of which appears to preserve the lists.
There are no List Styles in the document — I believe the templates these are based on may pre-date the List Style concept (scary).And yes, I believe you that this could lead to instability.
I’m asking if I can upload the file, if I can, I’ll be back here shortly.
The customer is being very difficult — it’s a corporate merger and they’re trying to get the features of both companies’ templates to work together.
They’re asking for a “unified” template that merely attaching to and updating styles will make everything work happy happy… no macros to clean things up. That may be impossible.I would advise changing the “Supportive” items to captions that capture the Heading numbering — which has its own nightmares, but one I know how to manage. But that requires running a clean-up routine after attaching the template.
-
WSjoelfinkle
AskWoody LoungerThrough the assistance of a partner company of ours, I have the (lousy) answer:
The Selection.Style method fails with error 91 if more than 50 paragraphs are selected.
That’s lame, lame, lame.
But at least I can test for it. -
WSjoelfinkle
AskWoody LoungerHi joelfinkle,
I’m not seeing the behaviour you describe. Using the document attached to your post, I ran the following code with a variety of selections:
Code:Sub Test() Dim oPara As Paragraph, sStyles As String For Each oPara In Selection.Paragraphs sStyles = sStyles & oPara.Style & "*" Next MsgBox Replace(Trim(sStyles), "*", Chr(10)) End Sub
Each time, I was able to retrieve the style names without difficulty.
Perhaps we’d get a better idea of where the problem lies if you post your code.
Macropod,
The problem occurs when the entire table is selected, on Selection.Tables. I’m going to check on the Table Style issue — perhaps that’s what’s causing my problem.
Part of my code must deal with users selecting arbitrary text — which could be the table, it could be a few random paragraphs.In one part of code, I apply or remove (the latter is tricky, involves a temp doc where I delete the style — you can’t just do a .font.reset or you lose bold, fonts, etc.) a character style to whatever is selected, based on whether the text is already in the character style, e.g.
sStyle = Selection.Style ‘ Throws error
if sStyle “My Character Style” then
Selection.Style = “My Character Style”
else
RemoveStyleFromText Selection.Range, “My Character Style”
end ifChecking each paragraph individually is not acceptable: it may not be entire paragraphs, and I want to know if *all* of the text shares the style.
Selection.Style ought to work, but doesn’t. -
WSjoelfinkle
AskWoody LoungerThere is a fix to this problem — Microsoft has issued a hotfix:
http://support.microsoft.com/kb/970942/
It doesn’t admit to fixing this particular problem, but it does.
The KB969604 causes Word 2007 to write utter crap into the docVar elements of the settings.xml file in the Word folder of the ZIP package. Meanwhile, the in-memory version is still fine, so you don’t discover the problem until you next open it. Needless to say, if your document variables have been crapped on already, the hot fix won’t correct them. Backup is your friend.
The skinny on other boards is that this isn’t likely to be part of an official patch until Office 2007 SP3.
-
WSjoelfinkle
AskWoody LoungerWell, you could perhaps have one pic control and use the loadpicture command to change its picture. That way you can leave the picture control empty in design mode?
Innnnnteresting. I hadn’t tested to see whether an empty pic control eliminated the death spiral.
The only other downside is the need to make the pictures available in the distribution as separate files. Not a huge deal, but an annoyance (the system then needs to be able to find them — that’s the nasty part) -
WSjoelfinkle
AskWoody LoungerWell, I got it running without constant crashes.
The culprit was the dialog with a large background image.
However, changing to a JPG (instead of the BMP) gave me the same result, as did creating small images for the important content (company and product logos) placed in picture controls.The primary symptom is that when opening the template, or creating a new doc based on the template, then going into VBA, checking the “Debug” menu would show the Compile menu item available, which is normally only available if you have made a change. Of course, choosing that menu would cause the crash.
This was happening even rebuilding that form from scratch, after rebuilding the entire template starting with a doc created from Normal.dotm (which is pretty darn empty except for a few utility routines — no goofy styles), connecting to the references (ADO 2.8, Scripting Runtime, and a company licensing object), and importing each piece of code back in.
The funny thing is, I have another form with picture controls on it, and it doesn’t die. The only difference I can see is that the picture control is in a frame.
(By the way, if there’s a way to put pics in a combo box without bringing in a 3rd-party control, I’d appreciate it. Another programmer created a messy little thing using a spin control and a frame, and changing the position of the image in the frame to simulate a choice by the position)
-
WSjoelfinkle
AskWoody LoungerI’d split up the largest module in at least two modules. There is some sort of a 64k limit on module size, but it isn’t consistent. You may have hit it here though.
I’ve done that, but I don’t think that’s the culprit (still crashing).
The most likely suspect right now is a form with a 500+K image in its background (created by our marketing people, natch). Reloading that form, deleting the image and replacing it with smaller ones is still trouble, but I’m guessing it pegged some memory block, and there’s already trash in the project file. I’m going to rebuild that form from scratch (at least it’s relatively simple).If this next attempt doesn’t work, I’m throwing in the towel. Thankfully, this project is on spec, and not a dependency on an ongoing project. But I’d be a hero if I got it working.
-
WSjoelfinkle
AskWoody LoungerI’m quite confident you haven’t hit a limit on the size of the project itself. My largest project had significantly more code.
How large is your largest module (line count)?
…
Of course for userforms this method cannot be used. You could however move the code behind the forms to a notepad file as well, empty the module and then export the forms to be on the safe side.The largest module is 128K (about 2800 lines) in .bas form, which so far as I can tell is only a text file. That one is about 3X the size of any other .bas or .frm file
One of the forms has a .bmp background, and is over 521K — that was one of the last things added before things went south.What’s so frustrating here is that there’s no indication of anything being wrong: the code is correct, there’s no warnings that I’m doing something beyond the VBA limits.
Previous versions of this project have used a COM Add-In. I’ve been trying to back away from that because customers complain about having to run an installer will elevated privs, versus just pointing everyone at a Workgroup Template folder. But it looks like I won’t be able to add all this functionality, unless I get lucky on a rebuild this morning.
![]() |
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
-
Two blank icons
by
CR2
11 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
2 hours, 36 minutes ago -
End of 10
by
Alex5723
5 hours, 16 minutes ago -
End Of 10 : Move to Linux
by
Alex5723
5 hours, 45 minutes ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
2 hours, 14 minutes ago -
test post
by
gtd12345
11 hours, 17 minutes ago -
Privacy and the Real ID
by
Susan Bradley
1 hour, 24 minutes ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
2 hours, 14 minutes ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
15 hours, 38 minutes ago -
Upgrading from Win 10
by
WSjcgc50
3 hours, 3 minutes ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
10 hours, 44 minutes ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
1 day, 7 hours ago -
The story of Windows Longhorn
by
Cybertooth
19 hours, 2 minutes ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
1 day, 9 hours ago -
Are manuals extinct?
by
Susan Bradley
5 hours, 31 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
1 day, 18 hours ago -
Network Issue
by
Casey H
1 day, 5 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
2 days, 6 hours ago -
May 2025 Office non-Security updates
by
PKCano
2 days, 6 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
2 days, 8 hours ago -
pages print on restart (Win 11 23H2)
by
cyraxote
1 day, 9 hours ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
2 days, 10 hours ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
2 days, 10 hours ago -
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
2 days, 18 hours ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
1 day, 10 hours ago -
Asking Again here (New User and Fast change only backups)
by
thymej
3 days, 5 hours ago -
How much I spent on the Mac mini
by
Will Fastie
13 hours, 6 minutes ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
1 day, 8 hours ago -
Spring cleanup — 2025
by
Deanna McElveen
3 days, 11 hours ago -
Setting up Windows 11
by
Susan Bradley
2 days, 6 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.