Discussion:
2nd Word doc appears after Word template - only in Vista
(too old to reply)
Mojo
2009-05-09 19:39:31 UTC
Permalink
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
Nobody
2009-05-09 19:55:02 UTC
Permalink
See the Saved Property. It's read/write.
Mojo
2009-05-10 12:50:08 UTC
Permalink
Hi Nobody

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

"Nobody" <***@nobody.com> wrote in message news:***@TK2MSFTNGP05.phx.gbl...
See the Saved Property. It's read/write.
Nobody
2009-05-10 13:01:00 UTC
Permalink
Post by Mojo
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

Loading...