Normal.dot keeps bugging me!!

M

Mojo

Hi All

I've created a vb6 app that opens up a Word template file, populates it with
stuff and then displays the doc. This all works fine, but when I go and
close the doc (with or without saving it) I keep getting warning messages
saying do you want to save the changes to the normal.dot file.

I haven't touched it!!! I'm using my own .dot files and when my app calls
the page it opens up a fresh blank copy doc of the template.

I'm a good lad in that my app:

* creates a Word object rather than a straight Word reference,

* opens up the template

* populates the created copy of the template

* shows the doc, ie visible = true

* activates the doc

* finally kills the object

I get no normal.dot warnings until I close Word down and get in this
infernal loop of do you want to save changes, save dialogue box appearing
and so on until I go click happy!!

Any ideas?
 
B

Brian Kelly

Mojo said:
Hi All

I've created a vb6 app that opens up a Word template file, populates
it with stuff and then displays the doc. This all works fine, but
when I go and close the doc (with or without saving it) I keep
getting warning messages saying do you want to save the changes to
the normal.dot file.

I haven't touched it!!! I'm using my own .dot files and when my app
calls the page it opens up a fresh blank copy doc of the template.

I'm a good lad in that my app:

* creates a Word object rather than a straight Word reference,

* opens up the template

* populates the created copy of the template

* shows the doc, ie visible = true

* activates the doc

* finally kills the object

I get no normal.dot warnings until I close Word down and get in this
infernal loop of do you want to save changes, save dialogue box
appearing and so on until I go click happy!!

Any ideas?

You sure asked in a lot of places.

Application.DisplayAlerts = wdAlertsNone 'wdAlertsNone = 0
 
K

Klaus Linke

You're sure it is your code that causes the message? Often there are add-ins
(even ones from MS) that change the Normal template.

If it *is* your code, you could look at the .Saved property of the Normal
template, and check at which point that turns false.
Since you seem to change document properties (as you told in your other
thread): Sometimes the customization context gets messed up, and your code
might change the doc properties of Normal.dot instead of those in the active
document.

Regards,
Klaus
 
K

Klaus Linke

Hi Mojo,
I couldn't find any other solution that would enable me to set the
filename box when a user goes to save as on my document.

Not sure what WordBasic code you currently use, but what I posted in the
other thread should set the "Title" built-in document property:
ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle)="Report 12-5-10"

Do your users have to fill out the Properties dialog?
In Word 2003, that dialog does not have a wdDialog constant... The needed
constant is 750:
Dialogs(750).Show
If you've set the Title property before, the file name you've given should
appear in the dialog.

You could also intercept the FileSaveAs command, and put your chosen file
name in that dialog before the user sees it.

You could also make doubly sure by checking the file name right before the
file is closed, in a
Sub FileClose()

I haven't done stuff like that for a long time, so I'm probably missing
things.
You should find useful articles and tips on the word.mvps.org site or in the
Microsoft knowledge base, such as maybe
http://word.mvps.org/faqs/macrosvba/SetDefFilename.htm
http://word.mvps.org/FAQs/MacrosVBA/InterceptSavePrint.htm

Klaus
 

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