Can I set the value that MS word will use in the 'Save' dialog ?

Usually when a word document is saved, Word will select the first few words of the document in an attempt to auto-create a document name. But I have a textbox near the top of the document that will contain the customers name, and then the user exits the field I want to be able to set the value that word will use to save the document.

Any help is appreciated.

Recommended Answers

All 3 Replies

If I've read your post correctly I think your talking about changing the file name from something other than what Word suggest. I mean if you have a document with the single sentence "Hi there" in it, Word will use that as the filename, but you should be able to simply erase it and write a new name before saving.

If I've read your post correctly I think your talking about changing the file name from something other than what Word suggest. I mean if you have a document with the single sentence "Hi there" in it, Word will use that as the filename, but you should be able to simply erase it and write a new name before saving.

Yes, but I would like to do this programmatically. In theory word holds the name of the document somewhere and you should be able to get at it through VBA. If I let the user fill out the form and save it and suggest a name, you could get anything.

will this one help

Sub save_as()
Dim str As String

str = InputBox("Pls. enter filename to be saved")

 ActiveDocument.SaveAs FileName:=str & ".doc", FileFormat:=wdFormatDocument
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.