Autonew won't work

L

Lee

I have templates which are saved in a Information System
(Document management) and when new users enter a
particular number in the Info System, a .doc version of
the template is produced. The userform and everything
works apart from the Userform won't automatically show
when the version is created. You have to manually run the
Userform. Does anyone have a suggestion to make this
userform run automatically when a version is created?

Current code to show userform is:

Sub Autonew()
FrmOutwardLetter.Show
End Sub

As I said before, if you manually run this code, the form
shows but it won't automatically run when a new doc
version is created...

Thanks
lee
 
C

Charles Kenyon

Any chance your external procedure is not actually creating a new document
but rather opening your template and then using SaveAs or the equivalent to
save the new "doc?"

Which version of Word are you using? If Word 97-2000 your new doc would
actually be a Word template if that is what is happening (even if it has a
..doc extension). You can test for this by opening such a doc in Word and
using SaveAs. In Word 97-2000 it will only let you save as a template.
 
L

Lee

Thanks for your reply Charles

We are using Word 2002.

I tried using SaveAs and the file extension is .doc. I
also looked through the file system and found
the "template" (base document) which is used through the
Info System and that also seems to be a .doc.

I will have to find out exactly how the Info System
creates new documents from the "template" (or base
document). I think it creates a copy of the base document
and then uses SaveAs behind the scenes. Trying to talk to
the company who wrote our Info System or get information
from them is like trying to get blood out of a stone.

Regards
Lee
 
L

Lee

Charles

Just a little more to my previous post - I tried to save
the "template" (base document) and it tells me that the
file is read-only (M:\usmodel\O588867.doc)
So... the base document is definitely a .doc that has
access permissions and it generates a copy of this with
the SaveAs method "behind the scenes".

Lee
 
D

Doug Robbins - Word MVP

Can you manually create a new document from the template OUTSIDE of the
document management system by using File>New and then selecting the
template. If you can and if when you do that, the userform is displayed,
then the document (mis)management system must be preventing automacros from
running. I am not sure how you can get around that.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
C

Charles Kenyon

I suspect that your new document is being created outside of Word (and thus
outside the vba context).
 
L

Lee

No I cannot create a new document based on the "template"
by clicking File>New. The "template" (or base document)
is not a .dot - it is saved as a .doc.
 
D

Doug Robbins - Word MVP

The system maybe opening the template and then forcing a save with a
different name, rather than using file new. Try changing the name of the
macro to AutoOpen and see if it works then.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
P

Paul Valente

Lee

Pretty sure that AutoNew will only run from a template. Also check if you
have the line "Option Private Module" at the beginning of the module tha
AutoNew is in. If you do remove it as it stops AutoNew executing.

Paul
 

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