Save As Macro with File Name

S

sally t

Is it possible to write a Save As Macro that I can run on exit from a form
field tht will prompt the user to Save As and also put in a filename
(standard filename that they can then amend). Let them save then continue
going through the form fields? Many many thanks. Sally T
 
C

Chris

Hi Sally

I "borrowed" most of this out of the Visual Basic Editor Help File, but did
a little editing to simplify it (it was from 2 seperate examples). I presume
this will slip into another macro if you're trying to prompt the user to do
the save after entering information into a field. You'll need to save it as
a piece of code and call it as a separate macro, or copy the 4 lines of the
macro into the correct spot of the other macro.

Sub SaveAsTextFileMacro()

strDocName = InputBox("Please enter the name " & _
"of your document.")
ActiveDocument.SaveAs FileName:=strDocName, _
FileFormat:=wdFormatDocument
End Sub

Is this what you were looking for?

Cheers

Chris
 
S

sally t

Help! I don't really know what I'm doing Chris but I tried using Macro -
Create and typing those instructions but nothing happens if I then try to use
Tools - Macro - select it and Run. What is the exact process for creating
such a macro to prompt File - Save As -I'm probably missing something vital
out, not being a VB person at all! Thanks

Sally
 
D

Doug Robbins

See the article "What do I do with macros sent to me by other newsgroup
readers

to help me out?" at:

http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

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