document_new

P

Perry

Hi tezza,

If y've programmed Document_New in template A and you want to create
documents
on template B at the same time expecting actions to happen in Document_New
of template A,
they won't execute.

Instead, program the actions in Document_New event of template B.

More info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbawd10/htm
l/woevtnew.asp
or
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/off2000/htm
l/wohowautomacros.asp
and take a look at
http://www.mvps.org/word/FAQs/Customization/WhatTemplatesStore.htm

Kindly repost if the above doesn't cover your problem.

Krgrds,
Perry
 
T

tezza

May i start by wishing everyone here a happy new year.
And now, my question.

We have a document management system which produces Word documents for us.
This process involves a user inputing data into the application which then
performs a merge from a template provided by us to produce the document.
However, any code provided by me within the template gets ignored &
stripped out by the merge.
What i've been trying to do is produce some automation functions to be fired
off within the Document_New event of the template, but these get ignored.
So my question is this...Can anybody suggest a way of working around this?
I'd like to avoid having to train users to click something once their doc is
produced and would like to keep things as automated as possible.
I'm guessing maybe something in Startup/Addins but i'm unsure.

Any help gratefully recieved
 
T

tezza

Hi Perry,

Thanks for the prompt response.
I dont think i explained myself clearly enough previously.
The process is as follows..
1) Data is input by the user into the management application
2) The user selects 'create Word document'
3) The application will attempt to 'merge' its data into a predefined
template (.dot) which may be a letter/fax etc
4) If the predefined template (.dot) contains code, it's ignored and
stripped out.
5) The result is a document (.doc) with no code.
6) What we'd like to do at the point where the document is produced is to
provide some automated functions, but with Document_New having been ignored
in the original template (.dot) and the resulting document (.doc) having no
code, we can't.

Hope this is clearer

Tezza
 
P

Perry

5) The result is a document (.doc) with no code.
6) What we'd like to do at the point where the document is produced is
to

Once a document is created from a template containing code, the
new document will have no code. Instead it will have a reference to
the template (the document was based on) containing the code unless
the NewTemplate argument of the Documents.Add() function is set to true.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbawd10/htm
l/womthAdd.asp

So I'll stick to my remarks as provided in my previous msg.
I'd say, try them out and repost where things are obstructing you from
yr goal.

Another article worth reading:
http://www.mvps.org/word/FAQs/Customization/WhatTemplatesStore.htm

Krgrds,
Perry
 

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