in

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
Movie Stars

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