#1   Report Post  
Aurora
 
Posts: n/a
Default Macro to Save Doc

I am using Word 2000
I want to create a macro to save a document in a
particular file. I created a macro called (SAVE) and when
thru the steps that I normally would to save a file
beginning with "save file as". I clicked on the pause
icon while recording to allow the user to enter a file
name and then hit the resume icon, "save" and then stopped
the macro. It worked as I was creating the macro. But
when I run the macro it does not work. It doesn't give me
any errors.

Does anyone have any ideas????

Aurora
  #2   Report Post  
Charles Kenyon
 
Posts: n/a
Default

Your macro will use whatever name you used when you recorded it. This is one
of many reasons that recorded macros are a kludge, at best.

Edit your macro and where you want the dialog insert

Application.Dialogs(wdDialogFileSaveAs).Show


--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"Aurora" wrote in message
...
I am using Word 2000
I want to create a macro to save a document in a
particular file. I created a macro called (SAVE) and when
thru the steps that I normally would to save a file
beginning with "save file as". I clicked on the pause
icon while recording to allow the user to enter a file
name and then hit the resume icon, "save" and then stopped
the macro. It worked as I was creating the macro. But
when I run the macro it does not work. It doesn't give me
any errors.

Does anyone have any ideas????

Aurora



  #3   Report Post  
Dian D. Chapman, MVP
 
Posts: n/a
Default

You can't record this type of code and what you want to do is a bit
more complex than you think. You need to learn some VBA and write a
procedure to do what you want.

This isn't the most efficient way, since you should be using File
System Object to set the folder path to the registry...but with little
knowledge, you can use this code to do what you want.

Plus, in order to overwrite the original SaveAs command, you need to
call the macro FileSaveAs and not just Save.

Add this code to your module and it'll do the job...more or less.
However, change the "myFolder" to the correct path that you need set.
But know that if the user doesn't have this path or if it is a network
path that is different on their system, you'll get an error...

Sub FileSaveAs()

Dim strFileName As String
Dim strPath As String

strPath = "c:\myFolder"

strFileName = InputBox("Enter the Save As name for this file")

Application.ChangeFileOpenDirectory strPath

ActiveDocument.SaveAs strFileName

End Sub

Note...to understand how to use the above code, read this TechTrax
article:

Sharing Macros
http://pubs.logicalexpressions.com/P...cle.asp?ID=166

Dian D. Chapman, Technical Consultant
Microsoft MVP, MOS Certified
Editor/TechTrax Ezine

Free MS Tutorials: http://www.mousetrax.com/techtrax
Free Word eBook: http://www.mousetrax.com/books.html
Optimize your business docs: http://www.mousetrax.com/consulting
Learn VBA the easy way: http://www.mousetrax.com/techcourses.html



On Fri, 22 Apr 2005 11:49:29 -0700, "Aurora"
wrote:

I am using Word 2000
I want to create a macro to save a document in a
particular file. I created a macro called (SAVE) and when
thru the steps that I normally would to save a file
beginning with "save file as". I clicked on the pause
icon while recording to allow the user to enter a file
name and then hit the resume icon, "save" and then stopped
the macro. It worked as I was creating the macro. But
when I run the macro it does not work. It doesn't give me
any errors.

Does anyone have any ideas????

Aurora


  #4   Report Post  
Robert M. Franz
 
Posts: n/a
Default

Hi Aurora

Aurora wrote:
I am using Word 2000
I want to create a macro to save a document in a
particular file. I created a macro called (SAVE) and when
thru the steps that I normally would to save a file
beginning with "save file as". I clicked on the pause
icon while recording to allow the user to enter a file
name and then hit the resume icon, "save" and then stopped
the macro. It worked as I was creating the macro. But
when I run the macro it does not work. It doesn't give me
any errors.


The following brand new article on the MVP site should make a good read
for you:

How to modify a recorded macro (by Jay Freedman)
http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm

Greetinx
Robert
--
/"\ ASCII Ribbon Campaign | MS
\ / | MVP
X Against HTML | for
/ \ in e-mail & news | Word
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for timestamp and save as ranfan Microsoft Word Help 1 April 23rd 05 09:30 AM
How do I use macro/ other feature of word to save a new copy word Random New Users 4 March 24th 05 01:23 PM
How do use macro or some other feature to save a new copy of word. Random Microsoft Word Help 1 March 23rd 05 04:49 PM
macro to save rtf file as txt reballdad Microsoft Word Help 1 December 20th 04 11:17 PM
Save As is not working due to macro security settings Craig Meritz Microsoft Word Help 1 December 16th 04 04:53 AM


All times are GMT +1. The time now is 10:24 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"