Designating FILENAME

R

R. Wong

I have a program in which I want a fill in window to pop up so i can add or type in the file name. I want to avoid having to click FILE ---> SAVE, etc
 
J

Jezebel

and the problem is ....?



R. Wong said:
I have a program in which I want a fill in window to pop up so i can add
or type in the file name. I want to avoid having to click FILE ---> SAVE,
etc.
 
R

Randy

Trying to create a FILLIN window or some other prompt to create a value for FILENAME other than clicking and saving the usual way..............i am trying to make this idiot proof

Is there a way to designate a value for FILENAME

Does this help?
 
D

Doug Robbins - Word MVP

Create a macro named Autonew in the template from which the document is
being created that contains the following code:

Dim docname As String, fpath As String
GetName:
docname = InputBox("Enter the name under which this document is to be
saved.", "Name File")
If docname = "" Then GoTo GetName
fpath = Options.DefaultFilePath(wdDocumentsPath) & "\"
If Dir(fpath & docname & ".doc") = "" Then
ActiveDocument.SaveAs docname
Else
MsgBox "A file with that name already exists. Please enter another
name."
GoTo GetName
End If


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Randy said:
Trying to create a FILLIN window or some other prompt to create a value
for FILENAME other than clicking and saving the usual way..............i am
trying to make this idiot proof.
 
J

Jezebel

Not much. Is your probelm getting the filename from the user, or applying it
the document once you've got it?

There are any number of ways to do the first, and the second is pretty
obvious. What have you tried so far and what goes wrong?




Randy said:
Trying to create a FILLIN window or some other prompt to create a value
for FILENAME other than clicking and saving the usual way..............i am
trying to make this idiot proof.
 

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