Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename word document while opening & NO SAVE

Status
Not open for further replies.

ferrisbb

Technical User
Nov 15, 2002
8
0
0
US
Any idea how to open a word document or template and rename it without saving it. The idea is that the document/template is filled with data and the user has the choice of saving or not, will only need to click the x and then yes to the save question. If yes, it will be saved as the new file name. Trying to lower possibility that the template gets overwritten with a filled in document.
This one has me stumped.
 
Hi!

Try it like this:

*** Note: untested code ***

Dim WordTemplate As Word.Document

Set WordTemplate = Word.Documents.Open("YourDocPath")
WordTemplate.SaveAs filename:="YourNewNameAndPath"

hth


Jeff Bridgham
bridgham@purdue.edu
 
Hi again!

Sorry, you said with no save. I haven't been able to find a method to do that.



Jeff Bridgham
bridgham@purdue.edu
 
Thanks for the try. I am in the same boat...no way to do it without saving it.
 
Why don't look at it a different way.

First copy the template, rename the file from dot to doc and place it where you want. Then open the doc file. You can copy-rename-put it someplace with FileCopy.

example: FileCopy ""C:\YourPath\Tempate.dot", "C:\YourNewPath\Document.doc"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top