Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document,.SaveAs without saving a template

Status
Not open for further replies.

drkestrel

MIS
Sep 25, 2000
439
GB
I have a word template with an ActiveX Control in it. A 'feature' of that template is that when you open a new document based on such a template, word thinks/has changed the template as well. However, such a template is now set to readonly. Hence, when I do a objWordDoc.saveAs("whatever.doc"), a dialog box pops up in word asking me to save the template.

How could I stop word from doing that?
I tried
Code:
wordApp.displayAlerts = false
already, but doesn't work. I can't find a parameter in the SaveAs method that has got anthing to do with Not saving the underlying template.
 
try putting

Code:
objWordDoc.AttachedTemplate.Saved = True

before

Code:
objWordDoc.saveAs("whatever.doc")
 
I get error 'True' is undefined with this code.

I note that the AttachedTemplate Property is a variant! FYI, I am using Word 2000 SP1.
 
Correction
I was doing it in JavaScript and should be using true instead of True

Anyway, I have a related problem.
For some reasons, with this 'special' template with an ActiveX Object in it, I get an error when I try to obtain
Code:
objWordApp.BackgroundPrintingStatus

saying that it is not an object or it is null in JavaScript. the code works with other documents. Note that the word application has not been quitted at that stage yet!
 
I don't know why you would have a problem getting objWordApp.BackgroundPrintingStatus (which as you may already know returns a 'Long')

If you cannot resolve this, you may want to try setting background printing to false so that your script would wait for your docs to finish printing before continuing. then you won't have to check the background printing status.

objWordApp.Options.PrintBackground = false

Note that I don't know anything about JavaScript so this may not help you.
In addition, I only have Word 97 on this machine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top