With ActiveDocument .SaveAs "Drive:\Path\" & A.CustomDocumentProperties("DocProp_1").Value & " - " & .CustomDocumentProperties("DocProp_2").Value & ".doc" End With
or
ActiveDocument.SaveAs "Drive:\Path\" & txtcontrol1.text & " - " & txtcontrol2.text & ".doc"
-- Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis.
Doug Robbins - Word MVP
"Marc Jurriens" <helmonder[ at ]hotmail.com> wrote in message news:ezLtv5azGHA.2076[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text] > How would such a command look in VB? I would be interested in doing > something at the end of the userform that would save the document using a > filename generated from docproperty fields, something like: > > SaveAs <NAME>"-"<VERSION>.doc .. > > Could this be done ? > > "Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> wrote in message > news:OAUFu1awGHA.3364[ at ]TK2MSFTNGP02.phx.gbl... >> Add a SaveAs command to the code that transfers the data from the >> userform into the document so that the document has already been saved >> with the desired name before the user starts working in the body of the >> document itself. Then all that they have to do is click on Save or Yes >> when they attempt to exit the document. >> >> -- >> Hope this helps. >> >> Please reply to the newsgroup unless you wish to avail yourself of my >> services on a paid consulting basis. >> >> Doug Robbins - Word MVP >> >> "Paul Warshawsky" <paulwarshawsky[ at ]vdn.ca> wrote in message >> news:en9HmqWwGHA.2260[ at ]TK2MSFTNGP03.phx.gbl... >>> I'm working on a UserForm for generating a letter to the referring >>> physician in response to a consultation. I generally name my documents >>> with the patient's last name and the date of the letter (e.g. Smith >>> 2006-08-16.doc) The UserForm, of course, gathers this info. When I >>> click Save or SaveAs I would like this to be the default filename. I >>> have tried putting this into the Title property >>> (BuiltInDocumentProperties("Title")), but it seems that changing the >>> title after the document is created from the template is too late (the >>> default name is the Title that was put in the template). Any other >>> suggestions? >>> >>> Thanks, >>> >>> Paul Warshawsky >>> >> >> > >
|