Setting filename for "Save as"

B

Bo Rasmussen

Hi,

When a document is created from a template, some userform shows up. When the
user is done filling in the form, the filename for the document can be
deduced. How Do i tell word the filename to use when the user chooses save
as?

Regards
Bo Rasmussen
 
J

Jezebel

Simplest is just to save the document at that point:

ActiveDocument.SaveAs FileName:=....
 
J

Jay Freedman

That's good if you can also deduce (or want to force) the folder to save the
document in. But if you want to "suggest" the proper name and path but still
let the user change it in the Save As dialog, you can do something like this
(see http://word.mvps.org/FAQs/MacrosVBA/ChangeSaveAsPath.htm):

With Dialogs(wdDialogFileSaveAs)
.Name = "C:\My Documents\" & DeducedFilename
.Show
End With
 
B

Bo Rasmussen

Thanks,

Finally I implemented a FileSaveAs in a global template. The title is
identical to the deduced filename

Sub FileSaveAs()
With Dialogs(wdDialogFileSaveAs)
.Name = ActiveDocument.BuiltInDocumentProperties("Title")
.Show
End With

End Sub

This seems to work alright :eek:)

Regards
Bo Rasmussen
 

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