Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro in Word 1

Status
Not open for further replies.

dk99

MIS
Joined
Jun 20, 2003
Messages
76
Location
GB
I have a macro in word and when it finished it automatically saves the file for me, but I want it to prompt me for the file name before it saves.

How can i do this ?

 
Use an input box

something like

filenam = InputBox(Prompt:="Enter filename")

then use the string filenam in the save command

dyarwood
 
thanx this works but can I get it to input just part of the file name.

For example the prompt would only ask for the date and then it would save it as:

date_newfile.doc

_newfile.doc is always the same only the date changes ?
 
Use the input box as above but then do the following

filenam = filenam & "_newfile.doc"

This will give the file name I would think you need

Is the date you want the present date?

If so you could try using the NOW() function.

dyarwood
 
Perfect - THANKYOU !
 
Not a problem, cheers for the star

dyarwood
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top