Document based on a template tries to save as the template

M

Mary Bray

Good morning,

I have an issue with Word 2003. I have built a number of templates that fire
code in the Document_New() sub to connect to a SQL database and fill in
values of a bunch of bookmarks.

If I have a copy of the template open (say Fred.dot), and then open a new
document based on the template all works correctly and I am propmpted to save
Document2 (or 3, 4 etc) when i go to close the new document.

If the template is not open, and I open a new document based on it the code
runs and gets the data (have used message boxes to confirm this) and bounces
round the bookmarks but does not write the data to the document. When I go to
close it I am prompted to save Fred.dot instead of Document2 (or 3, 4 etc).

Any ideas?
 
S

Summer

It would be more helpful to post your code in appropriate
Microsoft.public.word.vba.general and beginners groups for this problem.
 
M

Mary Bray

That's not terribly helpful. I considered the vba group (it is definitely not
a Beginner issue), but the problem seemed more related to the way a template
was opening rather than any code inside. I have never been in favor of
cross-posting as it tends to waste peoples time.
 
S

Summer

Mary, Documents.Add("Fred.dot")with path if on server."Mary Bray"
That's not
terribly helpful. I considered the vba group (it is definitely not
 
G

Graham Mayor

You expect someone to troubleshoot your code when you don't tell us what it
is? That's not very helpful either. The place for code related problems is
one of the the vba forums.

If you wish to post to more than one newsgroup, then put all the groups in
the same 'send-to' line separated by commas. This links the messages and
minimizes duplication of effort by those who respond to questions.

Whether you can do this from the web forums I hesitate to say, but you
certainly can from usenet - http://www.gmayor.com/MSNews.htm


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Suzanne S. Barnhill

What Summer failed to say is that this is an end-user NG (indeed, since it
is billed as General Questions in the Web portal from which you posted, it
is the ultimate end-user NG), and you are less likely to find VBA help here
than in one of the microsoft.public.word.vba hierarchy of NGs.
 

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