PDA

View Full Version : Saving a template as a document



Regouin
04-29-2005, 01:48 AM
Hello everyone,
I am having a problem with word. I created a template in Word with a table to fill in. no problems thus far.
Now i filled in the table and I want to save the filled in template as a word document. It is probably something very easy which i tend to overlook.
When I choose save as it wont let me change the file type. It just sticks to *.dot and no matter what I try it wont let me change it to *.doc
What on earth am I doing wrong? :banghead:

Frank

*edit*
I am using word 2000
*edit*

Killian
04-29-2005, 02:25 AM
Is there any reason why you can't do a new doc from the template and save that instead of actually opening the template?
Even so, I'm not sure why the file type can't be changed in the traditional wayActiveDocument.SaveAs "doc1.doc", wdFormatDocument

Regouin
04-29-2005, 02:30 AM
I dont know why on earth it bugs me like that but I just copy pasted the whole lot to a new document and then save it as a doc.

I tried out your macro and it tells me I cant save a template as a none template. Still wondering why on earth it wont let me change it back to or save it as a document

frank

MOS MASTER
04-29-2005, 10:58 AM
Hoi Frank, :D

Don't know if I fully understand you're question!

If you save a document as template you cannot save that copy back to a Word document!

What you should be able to do is save it as a Docfile. In that case you would actualy save it as a new file with the *doc extension. (You cannot overwrite a *dot extension with a *doc extension...only files with the same extension)

That is there are ways but the would not save the file in a true format as a *doc or *dot file! This way is to manualy change the extension from *dot to *doc..then it would look like one but still it won't be! (O and you can do this by code off course to..pointless but you can)

The thing that seams strange to me that you only get the save as *dot option???

The Save As dialog has a dropdown on witch you can choose the SaveAs format..can you confirm that this dialog is only giving you Template (*dot) format?

If so than I would think you're Word is corrupted somehow! (Cannot test with 2000 at the moment but I'm shure you can save a *dot as *doc for sure)

Enjoy! :whistle:

Howard Kaikow
04-30-2005, 01:57 PM
Hoi Frank, :D

Don't know if I fully understand you're question!

If you save a document as template you cannot save that copy back to a Word document!

What you should be able to do is save it as a Docfile. In that case you would actualy save it as a new file with the *doc extension. (You cannot overwrite a *dot extension with a *doc extension...only files with the same extension)

That is there are ways but the would not save the file in a true format as a *doc or *dot file! This way is to manualy change the extension from *dot to *doc..then it would look like one but still it won't be! (O and you can do this by code off course to..pointless but you can)

The thing that seams strange to me that you only get the save as *dot option???

The Save As dialog has a dropdown on witch you can choose the SaveAs format..can you confirm that this dialog is only giving you Template (*dot) format?

If so than I would think you're Word is corrupted somehow! (Cannot test with 2000 at the moment but I'm shure you can save a *dot as *doc for sure)

Enjoy! :whistle:

the proper thing to do is to NOT open the template in the first place. Instead, create a document based on the template and savethat document. That's what templates are 4.

MOS MASTER
04-30-2005, 02:01 PM
the proper thing to do is to NOT open the template in the first place. Instead, create a document based on the template and savethat document. That's what templates are 4.
Shure but that wasn't the question! :whistle:

fumei
05-02-2005, 07:31 AM
Maybe it was not the question, but some times the wrong question is asked. I totally agree with Howard. A .DOT file should never be opened by a user. It defeats the whole purpose of a template file.

Nevertheless, has this been solved for you?

Regouin
05-02-2005, 07:35 AM
Problem has been solved yes, i just copy pasted the whole lot to an empty doc file. And I just can't choose *.doc from the drop as a Save As option. And when I force it to save it as a doc by VBA it also gives an error.
I guess i just shouldnt play around with templates anymore :P

fumei
05-02-2005, 09:31 AM
No, heck no. Play with templates all you want. Templates are GOOD. Templates are very good.

Templates, however, are designed to be cloned (using File, New), thereby creating an exact duplicate of themselves. The clone is titled Document1 (or 2, or 3...whatever is the current number for a new "empty" document).

It may help to understand that when you open Word and get anew blank document (Document1), but is actually happening is Word is cloning a template - normal.dot.

If, for example, you actually OPENED normal.dot and added text into it, when ever you opened a blank new document, that text would be there. Normal.dot is a template. Word automatically uses it.

If you have a template and clone it (the way templates should be used), then what happens is a "blank" new document. That blank bnew document is a clone of the template, and can, of course, not be blank at all. It can be your fillable form. The user does their thing and saves the file.

Or YOU save the file - depending on is your requirements.

The important part is...the template file itself is NOT opened, is NOT changed. Usually templates are read only. I actually have mine as read only, but on file open (this is the mplate file itself), it checks for current system logon name, and if it is me, it resets the attributes and removes read-only. As I want to be able to write to it. The reason you want to keep it read-only is that users can manually change a style and Word will prompt on file close if you want to save changes to the template.

I of course do not want users to change my template. You can also make other ways of preventing user changes to a template, but that is a whole discussion in itself.

Again, no, please DO use templates. Sometimes (it is true) it may be better to use a .DOC file for user input on a form, but if so, it is a best practice to always do an immediate programatic SaveAs (thus preserving the original file).

Regouin
05-02-2005, 11:38 PM
I wont be let down that easy, I will play around some more with templates, because I think it has some great stuff going for empty forms and such. so will play around with it some more, and I always have the boys and girls at VBAX to save me when i screwed up :)

MOS MASTER
05-03-2005, 10:52 AM
and I always have the boys and girls at VBAX to save me when i screwed up :)
Hoi Frank, :D

Zo is het maar net!

Glad your making progress on this! :thumb