Word 2007 VBA: Documents.Add results in template being locked?

The issue is that the template is on a network drive - this is a pretty common issue. One way to get around it is to have your calling template copy over that template locally first and then create a new doc based off of that (and then delete the template when done).

One way around this is detaching the document from the template after it is generated: Dim doc As Document Set doc = Documents. Add(Template:="F:\templates\letterhead. Dotm", NewTemplate:=False, DocumentType:=0) Set doc.

AttachedTemplate = Nothing Alternatively, change the filesystem permissions on the template so only you have write access.

Awesome, thanks man. – gravyface Jul 26 '10 at 14:01 Hate to take it away, but I'm getting a syntax error on Set doc. AttachedTemplate = Nothing stating, "Run-time error '5946': 'Name' is not a by reference property." – gravyface Jul 27 '10 at 18:32 Ok, I was able to get it to work by changing doc.

AttachedTemplate = "", which a MsgBox confirms it defaults it back to Normal.dotm. However, the template is still locked, so this method doesn't work. – gravyface Jul 27 '10 at 18:49 Oops I should test the code before I post it.

I am surprised it doesn't release the lock with your version. – Foole Aug 1 '10 at 11:23.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions