Cross Process Automation

F

francist

We have a number of executables which automate Word via its COM interface.
The code was originally developed for Word 6 and we have literally 100s of,
mostly, Word 6 templates which are merged with mainframe data by the
controlling applications.

We are currently migrating to Windows XP + Office XP and, although the code
still works OK, the macro virus warning keeps popping up causing the Users a
lot of annoyance.

Lowering the macro security level is not an option and neither is putting
the templates in a 'trusted' location.

Has anyone got any idea what needs to be done to allow external (C/C++)
programs to automate Word 2002 whilst avoiding the macro virus warning
popping up all the time?
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?ZnJhbmNpc3Q=?=,

The macro virus warning will pop up if a document contains something that's
initiated the VBA container. This could be macros, or ActiveX controls in the
document; even if the document no longer contains any such elements, the
container is still present, and will trigger the warning. Automating from an
external application, alone, should NOT be triggering this.

Besides the actions you mentioned, the only other possibility to suppress the
macro warning is to sign the VBA project in the documents with a digital
signature. This could be a commercially acquired certificate from a company
such as Verisign or Thawte. Or it could be a signature generated from a
certification service setup on a company's own network.
We have a number of executables which automate Word via its COM interface.
The code was originally developed for Word 6 and we have literally 100s of,
mostly, Word 6 templates which are merged with mainframe data by the
controlling applications.

We are currently migrating to Windows XP + Office XP and, although the code
still works OK, the macro virus warning keeps popping up causing the Users a
lot of annoyance.

Lowering the macro security level is not an option and neither is putting
the templates in a 'trusted' location.

Has anyone got any idea what needs to be done to allow external (C/C++)
programs to automate Word 2002 whilst avoiding the macro virus warning
popping up all the time?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
F

francist

Hi Cindy,

Thanks for the reply. The problem is that these are Word 6 templates i.e.
they are not VBA... In those days it was WordBasic (the documents are still
mainly automated via the WordBasic object interface).

I'd really like to understand why we are getting the macro warnings - I'm
surprised when you say we shouldn't get any warnings when using an external
program; surely it's just as bigger security risk as with macros?

Do you know if it's possible to 'sign' a Word 6 template, or do they have to
be converted to a later version?
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?ZnJhbmNpc3Q=?=,
Thanks for the reply. The problem is that these are Word 6 templates i.e.
they are not VBA... In those days it was WordBasic (the documents are still
mainly automated via the WordBasic object interface).
I understood that; my experience with Word and WordBasic goes back to Word 2.0
:)
I'd really like to understand why we are getting the macro warnings - I'm
surprised when you say we shouldn't get any warnings when using an external
program; surely it's just as bigger security risk as with macros?
I suppose it's a matter of percpetion. An .exe file is an .exe file; people
generally install these explicitly and know they'll execute code. (Of course,
there are viruses that mask the extension, etc.) But with a template or
document, some users don't expect/understand they can contain malicious code.
Do you know if it's possible to 'sign' a Word 6 template, or do they have to
be converted to a later version?
If you haven't opened these in a later version, then allowed Word to save the
changes (thus converting the files), then I'd certainly do so. If for no other
reason than it should generally speed things up when opening/saving documents!
Word has to do a conversion everytime you use a Word 6.0 template, and at some
point (newer version) it may stop doing so automatically. It has been over
seven years, after all, since VBA was introduced (seems like only yesterday...)

And yes, then you could sign it.

It's possible that this conversion process also has something to do with the
macro warning. And do note: if these templates contain WordBasic code, it is
being converted to VBA. And this will certainly trigger the macro warning.

As a test, I'd convert a template by opening it, making a small change (to
dirty the file), deleting the change, saving, closing, re-opening (to complete
the conversion!), changing, saving and closing again. Then create a new
document from the template and see if it triggers the macro warning?

If it does, and if the templates really do NOT contain any code modules, then I
would seriously consider recreating these templates from a "clean" Normal.dot in
the current version of Word. Because this would be a sure indication that these
files' internal structures are damamged, and at some point the documents could
fail completely.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
S

Steve Rindsberg

I'd really like to understand why we are getting the macro warnings - I'm
I suppose it's a matter of percpetion. An .exe file is an .exe file; people
generally install these explicitly and know they'll execute code. (Of course,
there are viruses that mask the extension, etc.) But with a template or
document, some users don't expect/understand they can contain malicious code.

Or a matter of lawyers. If you run any old EXE, that's your business.

If you get bitten when running something from MS, even if it's just opening a
document in MS Word, MS gets the heat. MSAttorneys are allergic to heat. Makes
them sweat and wilts their collars.
 

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