sTemplate.replace() returns a string with that substitution. so you need to reassign it such as: sTemplate = sTemplate.replace('author1', author1) Anyway, Sion Arrowsmith above showed you a much better technique of filling all those values at once. Hope this helps, Ali