View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default Checking for macros in documents without opening them

You had better ask in a programming newsgroup such as
microsoft.public.word.vba.general for assistance with this.

--
Stefan Blom
Microsoft Word MVP


"AKA Bones" wrote:

Apologies if this is in the wrong group:

Does anyone know of a programatic way to determine whether a document /
spreadsheet / presentation contains one or more macros BEFORE the file is
opened?

We have a problem whereby macros in files are preventing our automated
process from completing because a macro has run and prompted the user for
input, but because we're opening the document using VB6 / .net using the
object model nothing is displayed so there's no way to close the prompt.

If we set the macro security in Word to high, all macros are prevented from
running but Word prompts the user when a document is opened which contains
macros: "The macros in this project are disabled. Please refer to the online
help or documentation of the host application to determine how to enable
macros.". This prompt also prevents our system for processing the document
due to the dialog box.

If anyone can help I would really appreciate it.

Cheers,
Andy