[Solved] Error-new document: template xxx.stw does not exist

Using them, Making them, Finding them
Post Reply
User avatar
rrobason
Posts: 4
Joined: Fri Mar 05, 2010 4:10 am
Location: California, USA

[Solved] Error-new document: template xxx.stw does not exist

Post by rrobason »

Whenever I create a new document from a template in Writer, I get the following error message:
[OpenOffice 3.1] Error creating a new document: /home/rob/Templates/RobsWebsite.stw does not exist. [OK]
There was such a template in the past, but I renamed and moved it to a new templates folder. The path /home/rob/Templates is no longer even in my Templates path for OO.

I can't figure out a) why I'm getting this message, and b) how to get rid of it.

Can anyone shed light on this?
Last edited by rrobason on Tue Mar 09, 2010 7:11 am, edited 1 time in total.
Rob Robason
OpenOffice 3.1 on Fedora 11
User avatar
Hagar Delest
Moderator
Posts: 32658
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Error creating new document: template xxx.stw does not exist

Post by Hagar Delest »

Hi and welcome to the forum!

Can you describe what you're doing exactly? What menus do you use to call that template?

Basically, you need to use the File>Templates>Organize dialog to manage your templates (import them for example). Never paste templates directly in the template folder with your file browser.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
rrobason
Posts: 4
Joined: Fri Mar 05, 2010 4:10 am
Location: California, USA

Re: Error creating new document: template xxx.stw does not exist

Post by rrobason »

Just to clarify: this error message occurs when I click File->New->Templates and Documents - and before the Templates and Documents selection dialog box appears.
Rob Robason
OpenOffice 3.1 on Fedora 11
User avatar
Hagar Delest
Moderator
Posts: 32658
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Error creating new document: template xxx.stw does not exist

Post by Hagar Delest »

Try to reset your OOo user profile. But during the welcome process (if you had 2.x before), don't transfer your personal data, former configuration files might corrupt the new profile.

Thanks to add '[Solved]' at beginning of your first post title (edit button) if your issue has been fixed.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
rrobason
Posts: 4
Joined: Fri Mar 05, 2010 4:10 am
Location: California, USA

Re: Error creating new document: template xxx.stw does not exist

Post by rrobason »

Hagar de l'Est wrote:Try to reset your OOo user profile. But during the welcome process (if you had 2.x before), don't transfer your personal data, former configuration files might corrupt the new profile.
Hagar:
Resetting the user profile cleared the problem. I'd like to recover as much of my old profile as possible, though. Now that we know the problem lies there, do you have any suggestions as to where to look for the specific error?
Rob Robason
OpenOffice 3.1 on Fedora 11
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved]Error-new document: template xxx.stw does not exist

Post by Villeroy »

I guess you declared that template as default template (the one that is used on File>New>Text). When you move a default template it is missing whenever you start a new document from no particular template.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
rrobason
Posts: 4
Joined: Fri Mar 05, 2010 4:10 am
Location: California, USA

Re: [Solved] Error-new document: template xxx.stw does not exist

Post by rrobason »

I did some digging and found the file that had the problem. I patched it by editing, but would have preferred that OO had permitted me to fix the problem though the UI.

The problem was in the file $HOME/.openoffice.org/3/user/registry/data/org/openoffice/ucb/Hierarchy.xcu. The removed template was there. Once I identified the culprit template, I was able to find it in the Template Organizer. I tried to remove it there, but only managed to crash OO. So I hacked the Hierarchy.xcu file and gave the missing template a pathname to an existent file. After restarting OO, I was able to use the Template Organizer to remove the unwanted template.

What struck me as buggy was that I could remove the template with the organizer only once the target file existed - and wasn't able to remove it otherwise.

Here's a sample of the the Hierarchy.xcu entry before my cleanup (not exactly the one I changed, but similar). I manually edited the "file:///" value to point to a file that existed:

Code: Select all

<node oor:name="Electronic%20letter%20template" oor:op="replace">
 <prop oor:name="TargetURL" oor:type="xs:string">
  <value>file:///home/shared/Templates/letterhead.ott</value>
 </prop>
 <prop oor:name="Title" oor:type="xs:string">
  <value>Electronic letter template</value>
 </prop>
 <prop oor:name="Type" oor:type="xs:int">
  <value>0</value>
 </prop>
</node>
After removing the hacked template using the Template Organizer, I was left with:

Code: Select all

<node oor:name="Rob%20Robason%20Home%20Page" oor:op="remove"/>
Anyway, my situation is back to normal. Thanks for the tip on the profile - it gave me a place to start looking, and now it's repaired so I haven't lost my customizations.
Rob Robason
OpenOffice 3.1 on Fedora 11
RonMackintosh
Posts: 2
Joined: Sun Dec 05, 2010 1:43 pm
Location: Australia

Re: [Solved] Error-new document: template xxx.stw does not e

Post by RonMackintosh »

I am afraid that this solution does not help the rest of us with the same problem. I have an identical problem. I will start a new thread for this problem.
Looks like a bug in the program to me.
OpenOffice Version 3.2.1 Build 9502
Windows XP Pro
Post Reply