Saving Files -Name derrived from text in document

D

Dennis Washington

I have a template which automatically assigns invoice numbers to each
document. I want to make ti so the file is automacically saved based on the
invoice number. The invoice number is in a bookmark



Any help would be appreciated
 
D

DA

Hi Dennis

Something similar to this should to the trick:

'-------------
With ActiveDocument
..SaveAs FileName:=("c:\" + _
.Bookmarks("Inv_number").Range + _
".doc")
End With
'-------------

Things to watch out for:
- Make sure your bookmark encloses the text you want to
use
- Invalid filename characters (ie. ":") in your bookmark
text.

Hope that helps,
Dennis
 
D

DA

Sorry, take out one of the "." in front of the SaveAs.
Don't know how that snuck in there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top