Live Scores
Shareware
Movie Stars
in
Visual Interdev
Applications
(Entire Site)
Questions and answers to issues related to Microsoft: Windows, Applications, Development, Hardware, Server, Internet Protocols, Database, Exchange .
»
Applications
»
Visual Interdev
»
VBA to detect a Word doc using a macro in normal.dot
VBA to detect a Word doc using a macro in normal.dot
Hi
I have a tool built in Access that scans spreadsheets and Word for macros. Is working OK, except for the case of a Word Doc that has a macro that is stored in normal.dot.
Is their any detectable flag/object (using VBA) that would indicate this?
Kelvin
Solution: VBA to detect a Word doc using a macro in normal.dot
Every document has an attached template.This is where any macros usually are. Less usually macros are in the document itself. The default template is the Normal template. Many users have macros there. Also there can be other global templates in the a user's Word Startup folder which contain macros. For this reason a document in one location can have access to macros that it doesn't have in another.
You can check check the attached template property with
objDoc.AttachedTemplate
and test for global templates:
For Each objAddIn In objWordApplication.AddIns
MsgBox objAddIn.Name
Next objAddIn