Determining whether Office documents contain macros

A

AKA Bones

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
 
B

Bob Buckland ?:-\)

Hi Andy,

You may want to also post this in the MS OfficeDev discussion group through the link below as you're looking at both Word and Excel.
You may also want to mention the versions of Office you're working on.

============
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 >>
--
Please let us know if this has helped,

Bob Buckland ?:)
MS Office System Products MVP

LINKS
A. Specific newsgroup/discussion group mentioned in this message:
news://msnews.microsoft.com/microsoft.public.officedev
or via browser:
http://microsoft.com/communities/newsgroups/en-us/?dg=microsoft.public.officedev

B. MS Office Community discussion/newsgroups via Web Browser
http://microsoft.com/office/community/en-us/default.mspx
or
Microsoft hosted newsgroups via Outlook Express/newsreader
news://msnews.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top