autoclose() - supressing save file message

A

Alpha

I have added a sub called autoclose() in a Word template that we setup for customer which runs just fine here. The autoclose has Activedocument.Saved = TRUE to supress the message box that ask to save the file when Word has printed the document and is being closed. The same setting doesn't work at our customer site.

I set the security as high in their Word 2002 (ours is Word 2000), digital sign with selfcert.exe for the template document and then added it to the Trusted Source tab when you click on Tools->Macros->Secruity.

When we run this template it still pops up the message box to save the file after printing the document as if the autoclose macro never ran or existed. However, there is no message or complants from the Word 2002 about the Macro

I connected to look at the certification of the macro in the template at our customer site. I click on the detail button and got the following message" This CA root certificat is not trusted because it is not in the Trusted Root Certification authorties store."
 
T

Tony Woodhouse

To prove whether the macro is running (but not working) or whether the macro
is not running at all, try putting a "msgbox("Hello!")" command somewhere in
your autoclose() macro. I suspect, your macro might be running, but not
working?

Instead of trying to force the state of the document.saved property, why not
try instead:-

ActiveDocument.Close (wdDoNotSaveChanges)

Hope that helps,
Tony W - Rugby - England

Alpha said:
I have added a sub called autoclose() in a Word template that we setup for
customer which runs just fine here. The autoclose has Activedocument.Saved
= TRUE to supress the message box that ask to save the file when Word has
printed the document and is being closed. The same setting doesn't work at
our customer site.
I set the security as high in their Word 2002 (ours is Word 2000), digital
sign with selfcert.exe for the template document and then added it to the
Trusted Source tab when you click on Tools->Macros->Secruity.
When we run this template it still pops up the message box to save the
file after printing the document as if the autoclose macro never ran or
existed. However, there is no message or complants from the Word 2002 about
the Macro.
I connected to look at the certification of the macro in the template at
our customer site. I click on the detail button and got the following
message" This CA root certificat is not trusted because it is not in the
Trusted Root Certification authorties store."
 
T

Tony Woodhouse

Another thought -
If you give them the macro by virtue of a template they open, could it be
placed in a template that is placed in their Word Startup directory. These
are automatically trusted (I think). We use this internally to run unsigned
macros, and no-one gets any security problems.

Cheers,
Tony W - Rugby - England
 
A

Alpha

I put the template path in the Word's Workgroup path in Tools>-options->File location. Is that a startup location for Word
Thanks.
 
A

Alpha

OK. I connected to the Customer site and placed the template in the Word Startup folder. I added the msgbox and it pops up so it's telling me that the MACRO autoclose() is being run. However, the message asking to save the file still popping up right before my message box i the autoclose().

I tried replacing the Activedocument.saved = TRUE with Activedocument.close but I got a mssage "Command failed" when I was closing the template

Is this just a bug in the Word2002? Because this whole thing works just fine here at my office using Word 2000

Thanks.
 
C

Cindy M -WordMVP-

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

One thing to test would be
- with no AutoClose macro
- user clicks the SAVE button, the closes

I seem to recall some issues recently that people were still getting prompted, but I
can'r remember the exact details. It could be a Security patch, or some kind of Addin
interfering with the document management, and not be directly related to the code at
all.

You might try a Google search in some end-user groups since the beginning of this
year.
OK. I connected to the Customer site and placed the template in the Word Startup
folder. I added the msgbox and it pops up so it's telling me that the MACRO
autoclose() is being run. However, the message asking to save the file still popping
up right before my message box i the autoclose().
I tried replacing the Activedocument.saved = TRUE with Activedocument.close but I
got a mssage "Command failed" when I was closing the template.
Is this just a bug in the Word2002? Because this whole thing works just fine here at my office using Word 2000.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
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 :)
 
A

Alpha

Thanks for everyone's input but I'm ready to just give up on this. It comes to find out that we have another customer who's running Word 2000 with no autoclose() code in the template but just Activedocument.saved = true in the template code right before calling Application.printout and it works just fine. They never get the pop up message box to save the file.

On my machine, running Word2000, the same setup won't work. I added the autoclose() and it works and supresses the message box. Another customer running Word 2002 will not work either way.

Thanks anyway but I'm ready to throw in the towel
 
T

Tushar Mehta

You might want to look into the _BeforeClose event. For more check the
'DocumentBeforeClose Event' (w/o the quotes) page in Word VBE help.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Business solutions leveraging technology
Microsoft Most Valuable Professional (MVP) 2000-2004
 

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