2nd Word doc appears after Word template - only in Vista 
Author Message
 2nd Word doc appears after Word template - only in Vista

Hi All

Apologies for the bizarre sounding subject text, but just wanted to put the
key factors in.

Basically I have a VB6 app that populates pre-created Word template docs and
everything is rosy on WinXP (all versions), but the same code on Vista does
the following:

1) Copy of Word template is populated and is displayed for user to look at
and if required they can save it to a diff filename.  Thus the template is
never overwritten.

2) If the user doesn't want to save the doc and simply clicks the close box
then the usual 'Are you sure do you want to save' message box appears.

3) HOWEVER, upon closing this copy, a 2nd message box appears saying do you
want to save changes to the original template!!!  Luckily the user has been
clicking No, but why is it doing this?

An example of one of my VB to Word 2000/2003 routines is as follows:

 Set oWord = CreateObject("Word.Application")
 Set oNewDoc = oWord.Documents.Add(App.Path & "\data\progress-inits.dot")

' = = = = = = = = = = = = = data goes in here

 oWord.Visible = True
 oWord.Activate

 Set oDoc = Nothing
 Set oNewDoc = Nothing
 Set oWord = Nothing

Straightforward stuff don't you think?

Like I said, the routines work perfectly well in XP, but in Vista they
generate this anomaly.

Has anybody had this before?  Is there a workaround?

Many thanks



Thu, 27 Oct 2011 03:39:31 GMT  
 2nd Word doc appears after Word template - only in Vista
See the Saved Property. It's read/write.


Thu, 27 Oct 2011 03:55:02 GMT  
 2nd Word doc appears after Word template - only in Vista
Hi Nobody

Thanks for your response, but what will that do for me???


See the Saved Property. It's read/write.



Thu, 27 Oct 2011 20:50:08 GMT  
 2nd Word doc appears after Word template - only in Vista

Quote:
> Hi Nobody

> Thanks for your response, but what will that do for me???

You can mark the template as saved, so the user is not prompted to save it.
From MSDN Library - October 2001:

Example

This example saves the active document if it contains previously unsaved
changes.

If ActiveDocument.Saved = False Then ActiveDocument.Save

This example changes the status of the Normal template to unchanged. If
changes were made to the Normal template, the changes aren't saved when you
quit Word.

NormalTemplate.Saved = True
Application.Quit



Thu, 27 Oct 2011 21:01:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Access Automation to a word Template - 2nd post

2. Outlook form with Word Doc Template

3. contact auto-populate word doc template

4. Update a Table of Contents on a doc created from a template Word 2000

5. Large number of list templates in a word 2000 doc

6. Question for Peter Jamison On Copying Word Template to New Doc on the fly

7. concatinate two word templates to one doc

8. New word doc from Access embedded template?

9. Word 2000 SP1 - DOC/Template

10. vba code missing after opening a word template as doc

11. Template (Doc_New) not getting called w/ new doc - Word 2k

12. Insert Form Data into Word Doc / template

 

 
Powered by phpBB® Forum Software