Document based on a template tries to save as the template

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
It would be more helpful to post your code in appropriate
Microsoft.public.word.vba.general and beginners groups for this problem.
 
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.
 
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
 
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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
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.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Back
Top