Save .doc macro

G

GP

Hi all,

Im trying to achieve the following:

1. Create a macro to save a word document in a particular
directory (always) but prompting for file name everytime
they run this macro.

I could get the first part ok.
But abt prompting for file name?

Following is the macro I created to save the file in a
particular directory, but with the same name. I want
macro to prompt for file name everytim I run it?


Sub TEST1()
'
' TEST1 Macro
' Macro recorded 1/21/2004 by Priya Gurumurthy
'
ActiveDocument.SaveAs FileName:="TEST_DOC3.doc",
FileFormat:= _
wdFormatDocument, LockComments:=False,
Password:="", AddToRecentFiles:= _
True, WritePassword:="",
ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False,
SaveFormsData:=False, _
SaveAsAOCELetter:=False
End Sub

thanks in advance
Regards
Priya
 
E

Ed

You might check the VBA Help for Input Box Function, and use the resulting
string in FileName:= string & ".doc".

Ed
 
T

Tom Winter

GP said:
Hi all,

Im trying to achieve the following:

1. Create a macro to save a word document in a particular
directory (always) but prompting for file name everytime
they run this macro.

I could get the first part ok.
But abt prompting for file name?

Following is the macro I created to save the file in a
particular directory, but with the same name. I want
macro to prompt for file name everytim I run it?


Sub TEST1()
'
' TEST1 Macro
' Macro recorded 1/21/2004 by Priya Gurumurthy
'
ActiveDocument.SaveAs FileName:="TEST_DOC3.doc",
FileFormat:= _
wdFormatDocument, LockComments:=False,
Password:="", AddToRecentFiles:= _
True, WritePassword:="",
ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False,
SaveFormsData:=False, _
SaveAsAOCELetter:=False
End Sub

thanks in advance
Regards
Priya

Starting in Word 2002 or 2003 there is the FileDialogs property of the
Application object. Take a look at that in the help.

-Tom
 

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