Mike Tope
mike.tope at dsl.pipex.com
Thu May 27 16:07:01 CDT 2004
File Locations correct within Word ? Mine are of course correct but they're not related to these users or these documents. There's a multitude of users, and I have no desire to go round checking them out. And a multitude of documents, but I've got hold of one to try out on my C: drive. I know that with my template file locations, it ends up attached to normal.dot. Then I set my User Templates path to the new location and the document ended up attached to the Master.dot in that location. I saved, it looked like it worked but remember that's manual. You can't edit the Tools Templates AttachedTemplate thing back to the old location so I reverted to the submitted copy of the document. I run a "dir /s /b c:\temp\*.doc > docfiles.txt". I import that file into Access and VBA runs through each document opening it in Word, then checking the AttachedTemplate. I put in a line at the beginning to set my user templates location. I can pick on documents that are attached to the new server template location\Master.dot. The old server name is never seen from VBA. But I had some trouble getting the document to save. WdApp.Documents.Save or WdApp.ActiveDocument.Save just didn't do it. I've now set a Document.Saved = false just before. I could see the file was being saved. But when I opened it in Word afterwards the attached template is still the old servername. I put a bit in, if the attached template path is equal to the new server name\path\master.dot, set the attached template path equal to the new server name\path\master.dot. Sounds pointless, but does step through. Didn't achieve it either. But here's where it gets tricky now. Word is opened up visible from Access. I can step into the code, and check out what Word sees. It comes up with the old server name\path\master.dot in the attached template box (although VBA reports the new one). I can see that changes to the new one when it is set by the code. I can save the document myself and see Word doing it. The file date is updated. The code saves the file too, and still I can see the new server name in the box. Finish off the code, open Word, load the doc, and it's back to the old server name. Am I suffering from highly underintelligent disk cacheing ? I switched off and came home. Tomorrow I will see whether it has in fact successfully changed anything. Thanks for any ideas anyone may have. Mike Tope ----- Original Message ----- From: "Haslett, Andrew" <andrew.haslett at ilc.gov.au> To: "'Discussion of Hardware and Software issues'" <dba-tech at databaseadvisors.com> Sent: 27 May 2004 01:39 Subject: RE: [dba-Tech] MS-Word template location missing > Just a guess, but are thefFile locations correct within word? > > Tools -> Options -> File Locations? > > > > -----Original Message----- > From: Mike Tope [mailto:mike.tope at dsl.pipex.com] > Sent: Thursday, 27 May 2004 9:47 AM > To: Discussion of Hardware and Software issues > Subject: [dba-Tech] MS-Word template location missing > > Dear All > I can't be the first to see this. What solutions are there ? > > MS Word stores a reference to the attached template inside its documents. > Sounds like a good idea at first. > > Our projects people have over a period of years kept that template path on a > server that has now closed down (a year ago maybe). There is a new one, > different server but actually a very similar path therein (but not in my > User or Workgroup template paths). > > They've been using NT4 with Office 2000, loading up old documents just fine. > Now they're being given Windows XP with Office 2000, and their entire Word > document back catalog is a disaster. Each document they complain about (may > not be all in any given location) takes minutes (five or ten) to open on XP, > but NT4 machines still seem just fine. > > Investigation so far shows that the local XP machine is tapping its heels, > processor idle, for the duration. So it looks like maybe a DNS query is > going out for the missing server and the response when it comes is negative > anyway. Whereas maybe NT4 didn't bother about doing all that and just used a > nearby normal.dot straightaway. > > Interrogated from an Access mdb using a WdApp object, it still takes just > that long to open the document (with the switch/retry box up), but then > reports that it's attached to normal.dot. I can look in the live > Word/Tools/Templates&Addins, and the full URL of the missing template is > visible, but VBA doesn't see that at all. So I can't select a document for > editing based on having the wrong template attached. > > I put a line in my pc's hosts file to give the new server an alias of the > old servername. This speeds things up tremendously, but VBA still sees > normal.dot as the attached template. > > I'm still investigating; maybe I'll move my template location to where the > template is, or copy the template to my user or workgroup template location. > I presume the Projects people have suitable template locations entered > already, but I'll have to check. > > I have entered searches in google but I haven't found anyone else reporting > this - perhaps the solution is obvious to everyone else ? > > I'm afraid I'm a late night (UK) user only so I'll just have to collect your > ideas till tomorrow. > > Regards > Mike Tope