Prev: Apply-user-defined table style only to tables with no vertically merged cells
Next: Background picture doesn't display when taking copy off of a Word template
From: Mojo on 28 Mar 2010 08:44 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?
From: Brian Kelly on 28 Mar 2010 11:14 Mojo wrote: > 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 -- Brian Kelly Home Page http://kellybk.com Species Race http://speciesrace.com
From: Klaus Linke on 28 Mar 2010 13:10 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
From: Klaus Linke on 28 Mar 2010 13:20 BTW, if changing document properties is all you want to do, you may find this interesting: http://word.mvps.org/FAQs/MacrosVBA/DSOFile.htm Opening the files takes a lot of time, so if you can avoid it your code is much quicker... And you avoid any issues with the customization context. Regards, Klaus
From: Mojo on 28 Mar 2010 13:47
Hi Klaus Many thanks for your assistance on multiple queries!!! 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. WordBasic seemed the only way!! Is this still the case? Thanks "Klaus Linke" <info(a)fotosatz-kaufmann.de> wrote in message news:OykH9rpzKHA.2436(a)TK2MSFTNGP04.phx.gbl... BTW, if changing document properties is all you want to do, you may find this interesting: http://word.mvps.org/FAQs/MacrosVBA/DSOFile.htm Opening the files takes a lot of time, so if you can avoid it your code is much quicker... And you avoid any issues with the customization context. Regards, Klaus |