-
WSjoelfinkle
AskWoody LoungerFebruary 28, 2006 at 2:32 pm in reply to: Attached Template changes if created from .doc (2002/XP) #1002325(Edited by HansV to make URL clickable – see Help 19)
The full characterization and cure for this problem was found here
It’s an undocumented side effect of a Microsoft Office hotfix (sic), which is why we’ve only seen it on a few people’s machines, it’s only those folks who’ve bothered to get fully patched that have the problem.
Joel
-
WSjoelfinkle
AskWoody LoungerFebruary 28, 2006 at 2:16 am in reply to: Attached Template changes if created from .doc (2002/XP) #1002271> I’m not positive what you’ve done, but “cover page.doc” is 1) either a template renamed from a .dot extension to a .doc extension, or 2) it’s a document.
It’s a document.> If it’s a document, then the attached template will be the one that the “cover page.doc” document is attached to (i.e. joel.dot).
That’s what it’s supposed to do… and doesn’t after the first save (but if reset later it does stick)>I don’t know why the attached template should change, unless you are specifically doing something to make it change.
Nope, no hooks on FileSave or anything like that.> I’m not quite sure what you’re trying to accomplish by having .doc files as templates.
Several things
1) Macros are maintained in only one place, rather than the 200 ‘content’ templates
2) Macros are only available for documents based on the template (rather than being a global template)
3) .doc files, when placed in Documentum as their (cough) templates, make more .doc files. .dot files placed in the Templates cabinet of Documentum, make more .dot files (ick)Actually, after posting here, I found someone else who had the same problem.
A certain security hotfix for Office 2002 (and possibly 2003) causes this problem, which is fixable with an AutoNew macroSub AutoNew()
dim s as string
s = ActiveDocument.AttachedTemplate.FullName
ActiveDocument.AttachedTemplate.FullName = NormalTemplate.FullName
ActiveDocument.AttachedTemplate.FullName = s
end sub -
WSjoelfinkle
AskWoody LoungerFebruary 24, 2006 at 3:01 am in reply to: Wrong AutoMacro firing during documents.add (2000) #1001770I should have mentioned that — tried that too, still fired the Document_New
It definitely happened on a machine running Word 2000 SR-1, haven’t verified yet that it still happens in SP-3, although our trainer said it happened. -
WSjoelfinkle
AskWoody LoungerFebruary 24, 2006 at 1:24 am in reply to: Wrong AutoMacro firing during documents.add (2000) #1001760Nope. First thing I checked.
I’ve been able to reproduce it by installing Word 2000 on a VMWare session, then loading my template, but it’s definitely not loaded as a global or add-in.
Can’t get the same thing to happen at all on Word XP or 2003.
Framing the statement with WordBasic.DisableAutoMacros certainly stopped the problem.So at least I can get around this… now if Microsoft would only fix copying styles, section breaks, list templates….
-
WSjoelfinkle
AskWoody LoungerMy approach is to use VB (not VBA), which has a Clipboard.GetText(vbCFRTF) which will return the entire RTF as a string. The HTML might be easier to parse, especially as I want XML as my final output, based on info not obvious to Word 2003, and much less messy than WordML.
I can probably do the same thing using the SDK routines to get the clipboard, but for right now rapid prototyping, the Clipboard object is too easy not to make use of. -
WSjoelfinkle
AskWoody LoungerNnnnn…no.
I meant, how do you find how big the run of text is that shares the same formatting? This would help for those folks trying to find the font changes in a paragraph, conversions to odd formats, etc.
In the general case, it might be best to start with the WordML or RTF and parse from there, but if I’m trying to get some info about just a paragraph or two, it can be a lot of work, checking the characteristics character by character.
-
WSjoelfinkle
AskWoody LoungerKind of ugly and expensive on macro storage, but it’s what I’m leaning toward.
The problem is that there’s four ways to load a template:
1) Open a document that’s already attached: Document_Open traps that.
2) Create a new document from the template, or from a document that’s attached: Document_New traps that.
3) Installed as a global template: AutoExec traps that
4) Attached to an open document with Tools > Templates and Add-Ins. I’m up a creek. Nothing seems to ‘happen’ when the user does this. -
WSjoelfinkle
AskWoody LoungerI’m looking at a similar problem: I’m being asked to add license management code to my template, and I’m tryinig to figure out all the places I’d have to trap.
I can trap Document_Open and Document_New, check the license, and then do something nasty like attach to Normal.dot if they’re not valid users.However, neither of those events gets fired if the user goes to Tools > Templates and Add-Ins and just attaches to the template!
Voila, toolbars are back, full functionality has woken up!
I can’t create an application events module, because without the _Open or _New events firing, I can’t create the object that watches for events.Any suggestions?
I’d hate to have to add license-checking code to each and every macro that would be callable from a toolbar or from Tools > Macros > Macro… -
WSjoelfinkle
AskWoody LoungerAnother weird side-effect: if the document isn’t visible, Word’s range.find won’t find the empty cells at all. Much better results occur if the document is visible at least for a short period of time. Rendering it to the screen must have some side effect on the internal data structures.
It causes an unfortunate blink, but
oDoc.windows.Add
oDoc.windows(1).visible = false
does the trick. -
WSjoelfinkle
AskWoody LoungerY’know, of all the options, doing it *AGAIN* never occured to me.
It seems to take multiple passes for some messier tables, so I’m going
while .Execute(blahblah)
DoEvents
wendThanks much
Joelp.s. My first attempt at this ran on infinitely, stepping through it, it didn’t… I may not have solved it yet. Will let you folks know.
-
WSjoelfinkle
AskWoody LoungerHans,
Yeah, I was afraid of that. Typical non-orthogonality of the MS Office object model.
Most of the other objects have IDs, but styles are numbered less than zero for built-ins, and greater than zero alphabetically for user styles.
Patently absurd. I may just have to create a collection with the .namelocal as the key and the number as the value… waste of precious time and space.Joel
-
WSjoelfinkle
AskWoody Lounger(Edited by HansV to make URL clickable – see Help 19)
I should have posted that link. Been there, done that.
What I want is for the ADDIN field to have visible text too.Reference Manager and Endnote http://www.endnote.com[/url%5D both from Thomson, both manage to have visible text as well as storing data in the ADDIN field. There aren’t any nested fields.
There must be a way to reproduce the same effect.
-
WSjoelfinkle
AskWoody LoungerAny suggestions for automating detection or removal of that behavior? I’ve got lots of documents to process, and I’d like to be able to automate cleanup.
The MSWD KB wasn’t helpful. -
WSjoelfinkle
AskWoody LoungerAny suggestions for automating detection or removal of that behavior? I’ve got lots of documents to process, and I’d like to be able to automate cleanup.
The MSWD KB wasn’t helpful. -
WSjoelfinkle
AskWoody LoungerI’m already doing all of that — named list templates, styles tied to list templates, the whole nine yards.
This is happening in a brand-new doc based on a custom .dot file with things set up right, or so I thought.
![]() |
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
-
KB5061768 update for Intel vPro processor
by
drmark
55 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
1 hour, 57 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
12 hours, 58 minutes ago -
Office gets current release
by
Susan Bradley
17 hours, 41 minutes ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
1 day, 10 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
18 hours, 44 minutes ago -
Stop the OneDrive defaults
by
CWBillow
1 day, 11 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
1 day, 20 hours ago -
X Suspends Encrypted DMs
by
Alex5723
1 day, 23 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
1 day, 23 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
2 days ago -
OpenAI model sabotages shutdown code
by
Cybertooth
2 days ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
1 day, 12 hours ago -
Enabling Secureboot
by
ITguy
1 day, 19 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
2 days, 8 hours ago -
No more rounded corners??
by
CWBillow
2 days, 4 hours ago -
Android 15 and IPV6
by
Win7and10
1 day, 18 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
2 days, 20 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
2 days, 23 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
2 days, 18 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
3 days, 6 hours ago -
May preview updates
by
Susan Bradley
2 days, 18 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
2 days, 9 hours ago -
Just got this pop-up page while browsing
by
Alex5723
2 days, 23 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
2 days, 20 hours ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
1 day, 22 hours ago -
At last – installation of 24H2
by
Botswana12
3 days, 22 hours ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
20 hours, 13 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
4 days, 10 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
2 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.