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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Word Document Name?

Status
Not open for further replies.

rhpen

Programmer
Nov 2, 2005
40
US
ActiveDocument.name is read-only. Is there any possible way to change the name of the open, active document (keeping it open) in code without doing a "save as"?

Thank You
 
What is wrong with save as?

A wise man once said
"The only thing normal about database guys is their tables".
 
The process I need to go through for my project is this:

open the document

for each customer
add one line of text specific to this customer
change name of document (based on customer name)
convert to PDF
next customer

notes:
The line of text goes in the same place each time.
The rest of the document remains the same.
To have to "save as" each time will leave me with a whole bunch of document files that I don't need.
I'm only interested in the PDFs.
It would also add considerable time having to save the file each time.

Thank You,
 
Once the PDF is created, can you not change its name,
before the next pDF creation?

for each customer
add one line of text specific to this customer
change name of document (based on customer name)
convert to PDF

Name "C:\Docs & setts\Desktop\Customer.pdf As _
"C:\Docs & setts\Desktop\JaneDoe.pdf

next customer


 
Thanks Zion,

I have had tried something akin to your method except instead of renaming, I tried to move/copy the resulting file after each PDF creation. I had much trouble in that I could not get the macro to wait until the PDF was fully made (believe me I tried 100 different ways; ways which should have worked; including a waiting loop which just waited forever), thus generating an error by trying to copy too soon. I suspect I will get the same with a rename command, but I'll give it a go nonetheless.

RH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top