I am trying to save a Word file under a different name after I open and modify it.

I am using the wDoc.SaveAs2 functionality.

It is not working correctly. It tries to save the file under the original file name. Therefore, I get a prompt something like "The file already exists. Do you want to write over it?" - you know the message.

Why is it not trying to save the file using the path and new file name I give it in the FileName variable?

I can't post the database here, as it has sensitive address information. If you need to see the database, then I will have to do a little work to make a sanitized version. I am happy to do this if necessary.

1. Your template isn't a .dotx extension, so it's not really a Template file. 2. You're using the word "FileName" as a variable, which is rarely a good idea, since that's a Reserved Word. The interpreter is probably confusing your variable name with the actual Filename.

Try placing a Breakpoint on the line that's doing the SaveAs, and look at the value for FileName to see if it's incorporating the ID value from the recordset or not. If it's not, try using "strFilename" for your variable name instead.

Hope this helps,

Dennis

--------------------

(;,;) Li'l Cthulu says: Please talk about what you're trying to do, as well as how you're doing it.Changing your real table name to "Table1" and your real form name to "Form1" in your posts makes it more difficult to understand what's going on, not easier.Guidelines for Posting Questions

1. Yes, you are right. The word doc. is not a .dotx format. I am simply using bookmarks to insert the text from the database. So, perhaps the document is unfortunately named, but this does not affect the functionality.

2. I did check to see that the FileName variable is correctly creating the right string using the immediate window. It is working correctly. That said, your point is well made. I have changed the name to strFileName.

I am still having the original issue with the wDoc.SaveAs functionality.

Wow, that's just ridiculous. I am having a local mom-and-pop computer shop assemble a tower for me from scratch. Really looking forward to getting a new computer that does NOT have all of the "try me, buy me" stuff pre-installed.

Glad you figured it out.

Dennis

--------------------

(;,;) Li'l Cthulu says: Please talk about what you're trying to do, as well as how you're doing it.Changing your real table name to "Table1" and your real form name to "Form1" in your posts makes it more difficult to understand what's going on, not easier.Guidelines for Posting Questions